Skip to content

Support for pacman-style multi-level arguments #1361

@ncihnegn

Description

@ncihnegn

Bug or Feature Request Summary

I want to emulate archlinux pacman's style with two-level arguments.
I don't think clap can support this yet.
It feels like subcommands but it is still arguments.

Expected Behavior Summary

app -h shows the first level arguments.
app -Qh shows the second level arguments for first level argument Q.

Example:
First level: pacman -h

usage: pacman [...]
operations:
pacman {-h --help}
pacman {-V --version}
pacman {-Q --query} [options] [package(s)]
pacman {-R --remove} [options] <package(s)>
pacman {-S --sync} [options] [package(s)]
pacman {-U --upgrade} [options] <file(s)>

Second level: pacman -Sh

usage: pacman {-S --sync} [options] [package(s)]
options:
-y, --refresh download fresh package databases from the server

Actual Behavior Summary

FLAGS:
-h, --help Prints help information
-Q, --query
-y, --refresh
-R, --remove
-S, --sync
-U, --upgrade
-V, --version Prints version information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions