[gdal-dev] Any way to get an autocompletion for ogr/gdal utilities?

Thomas Gratier osgeo.mailinglist at gmail.com
Wed Feb 2 14:59:30 PST 2022


Hello,

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

> ogr2ogr      ogrinfo      ogrlineref   ogrmerge.py  ogrtindex

When using command line like git, I type `git commit --` then use again the
tab key and it returns something like below

> --ahead-behind      --date=             --include           --no-verify
      --reedit-message=   --status
> --all               --dry-run           --interactive       --null
       --reset-author      --template=
> --amend             --edit              --long              --only
       --reuse-message=    --untracked-files
> --author=           --file=             --message=          --patch
      --short             --verbose
> --branch            --fixup=            --no-edit           --porcelain
      --signoff           --verify
> --cleanup=          --gpg-sign          --no-post-rewrite   --quiet
      --squash=

So, I do expect a way to get autocompletion or choice when I do something
like `ogr2ogr -` followed by typing on tab key.

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?

Regards

Thomas Gratier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220202/c3d2456c/attachment-0001.html>


More information about the gdal-dev mailing list