<div dir="ltr"><div>Hi Markus,</div><div><br></div><div>Thanks for your answer. I'm on Linux box rather old e.g Ubuntu 18.04. My shell is bash.</div><div>I do not find any files for autocompletion within /usr/share/bash-completion/ related to ogr2ogr or any other GDAL binaries or elsewhere.</div><div>I've also tried to see the behaviour using gdal within conda and no autocompletion available too.</div><div>I've tried to test autocompletion within a zsh shell in case the issue could have been related to zsh "smartness" but no change.<br></div><div><br></div><div>So, what I've done after this various unsuccessful tests is looking at packages version of Ubuntu and I have found the issue.</div><div><br></div><div>Conclusion: I'm on an Ubuntu box too old<br><br>No GDAL autocompletion on below versions<br><br>- Bionic (18.04 LTS) <a href="https://packages.ubuntu.com/bionic/amd64/gdal-bin/filelist" target="_blank">https://packages.ubuntu.com/bionic/amd64/gdal-bin/filelist</a><br>- Focal (20.04 LTS) <a href="https://packages.ubuntu.com/focal/amd64/gdal-bin/filelist" target="_blank">https://packages.ubuntu.com/focal/amd64/gdal-bin/filelist</a><br><br>GDAL Autocompletion available on<br><br>- Hirsute (21.04) <a href="https://packages.ubuntu.com/hirsute/amd64/gdal-bin/filelist" target="_blank">https://packages.ubuntu.com/hirsute/amd64/gdal-bin/filelist</a><br>- Impish (21.10) <a href="https://packages.ubuntu.com/impish/amd64/gdal-bin/filelist" target="_blank">https://packages.ubuntu.com/impish/amd64/gdal-bin/filelist</a><br>- Jammy (22.04 upcoming LTS) <a href="https://packages.ubuntu.com/jammy/amd64/gdal-bin/filelist" target="_blank">https://packages.ubuntu.com/jammy/amd64/gdal-bin/filelist</a><br><br>The remaining issue would be about not getting autocompletion with conda although I tried with the latest version 3.4.1. I think I will open an issue at <a href="https://github.com/conda-forge/gdal-feedstock/" target="_blank">https://github.com/conda-forge/gdal-feedstock/</a></div><div><br></div><div><br></div><div>Regards</div><div><br></div><div>Thomas Gratier<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 3 févr. 2022 à 11:02, Markus Neteler <<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Thomas,<br>
<br>
On Wed, Feb 2, 2022 at 11:59 PM Thomas Gratier<br>
<<a href="mailto:osgeo.mailinglist@gmail.com" target="_blank">osgeo.mailinglist@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> On Linux, when I type `ogr` in a command line, and on the keyboard type on "tab" key, I get all binaries starting with `ogr` e.g<br>
><br>
> > ogr2ogr ogrinfo ogrlineref ogrmerge.py ogrtindex<br>
><br>
> When using command line like git, I type `git commit --` then use again the tab key and it returns something like below<br>
><br>
> > --ahead-behind --date= --include --no-verify --reedit-message= --status<br>
> > --all --dry-run --interactive --null --reset-author --template=<br>
> > --amend --edit --long --only --reuse-message= --untracked-files<br>
> > --author= --file= --message= --patch --short --verbose<br>
> > --branch --fixup= --no-edit --porcelain --signoff --verify<br>
> > --cleanup= --gpg-sign --no-post-rewrite --quiet --squash=<br>
><br>
> So, I do expect a way to get autocompletion or choice when I do something like `ogr2ogr -` followed by typing on tab key.<br>
><br>
> Is there an existing script or a tip I'm not aware? Or do I need to work to create it to get something similar to git command where there is a script to add autocompletion?<br>
<br>
AFAIK this requires bash/zsh completion support.<br>
<br>
E.g., for core Git, on my Fedora box it is defined in<br>
<br>
/usr/share/bash-completion/completions/git<br>
<br>
and part of the package:<br>
rpm -qf /usr/share/bash-completion/completions/git<br>
git-core-2.34.1-1.fc35.x86_64<br>
<br>
Likewise, there is<br>
<br>
/usr/share/bash-completion/completions/ogr2ogr<br>
/usr/share/bash-completion/completions/ogrinfo<br>
/usr/share/bash-completion/completions/ogrlineref<br>
/usr/share/bash-completion/completions/ogrmerge.py<br>
/usr/share/bash-completion/completions/ogrtindex<br>
...<br>
<br>
Here it works:<br>
ogrinfo --<tab><br>
--config --format --help-general --locale --pause<br>
--debug --formats --license --optfile --version<br>
<br>
Maybe you package installation is incomplete?<br>
<br>
Best,<br>
Markus<br>
<br>
-- <br>
Markus Neteler, PhD<br>
<a href="https://www.mundialis.de" rel="noreferrer" target="_blank">https://www.mundialis.de</a> - free data with free software<br>
<a href="https://grass.osgeo.org" rel="noreferrer" target="_blank">https://grass.osgeo.org</a><br>
<a href="https://courses.neteler.org/blog" rel="noreferrer" target="_blank">https://courses.neteler.org/blog</a><br>
</blockquote></div>