patchGNU Gengetopt - Patches: patch #9947, Bash autocompletion


You are not allowed to post comments on this tracker with your current authentication level.

patch #9947: Bash autocompletion

Submitter:  Grégoire Scano <gscano>
Submitted:  Mon 22 Jun 2020 07:11:35 AM UTC
Category:  None Priority:  5 - Normal
Status:  Works For Me Privacy:  Public
Assigned to:  gscano Open/Closed:  Open

Thu 06 Aug 2020 05:15:47 AM UTC, comment #1: 

The branch feature/autocomplete contains the submitted patch below.

The build process was then completed and tested to generate and include the bash autocompletion script for gengetopt itself in the build dir and the dist tarball.

This feature is ready to be merged in the develop branch.

Grégoire Scano <gscano>
Group Member
Mon 22 Jun 2020 07:11:35 AM UTC, original submission:  

This patch adds autocompletion (only for Bash at the moment) for the generated command line parser.

The program creates an additional file containing the autocompletion script to be sourced. Based on the configuration file, it tries to autocomplete option names as well as their potential optional or mandatory values. It respects as many attributes as possible such as options with a maximum number of occurrences, dependencies, groups and modes. Two argtypes are added: 'filename' and 'directory', being interpreted as a 'string' argtype when parsing the command line but instructing the autocompletion script to search and autocomplete file names and directories (this feature uses Bash _filedir autocompletion builtin).

It is possible to extend the autocompletion script by either overriding the generated Bash functions or passing names of custom autocompletion functions via the new 'autocompletion' attribute.

Grégoire Scano <gscano>
Group Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #49341:  patch.tgz added by gscano (24KiB - application/x-compressed-tar)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gscano (Submitted the item)
  • -email is unavailable- added by gscano

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-06 gscano StatusReady For Test Works For Me
    2020-07-30 gscano Carbon-CopyRemoved gscano -
    2020-07-30 gscano StatusNone Ready For Test
        Assigned toNone gscano
    2020-06-22 gscano Attached File- Added patch.tgz, #49341
        Carbon-Copy- Added gray_wolf
        Carbon-Copy- Added gscano

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code