Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: allow alias after global args #309

Merged
merged 1 commit into from May 12, 2022

Commits on May 11, 2022

  1. cli: allow alias after global args, and recursive aliases

    Our support for aliases is very naively implemented; it assumes the
    alias is the first argument in argv. It therefore fails to resolve
    aliases after global arguments such as `--at-op`.
    
    This patch fixes that by modifying the command defintion to have an
    "external subcommand" in the list of available commands. That makes
    `clap` give us the remainder of the arguments when it runs into an
    unknown command. The first in the list will then be an alias or simply
    an unknown command. Thanks to @epage for the suggestion on in
    clap-rs/clap#3672.
    
    With the new structure, it was easy to handle recursive alias
    definitions, so I added support for that too.
    
    Closes #292.
    martinvonz committed May 11, 2022
    Configuration menu
    Copy the full SHA
    628677f View commit details
    Browse the repository at this point in the history