Skip to content

alternatives: improve current option lookup #1678

Description

@scop

As far as I see the command-line parser of the redhat implementation, alternatives doesn't fix the orderings of the command-line options. In addition, there are extensions --family <1 arg>, --initscript <1 arg>, and --follower <3 args>. The orderings in the man page must be only for presentation.

We should explicitly see the nearest option name to generate the command line arguments.

Originally posted by @akinomyoga in #1639 (comment)

Code context was

                *)
                    case $((args % 4)) in
                        0 | 2)
                            _comp_compgen_filedir
                            ;;
                        1)
                            _comp_compgen -- -W '--slave'
                            ;;
                        3)
                            _comp_cmd_alternatives__installed
                            ;;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions