You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using klask to generate egui applications directly from clap. This allows me to turn cli applications into native gui apps or webapps for people unfamiliar with the command line.
However, I find that the names for subcommands benefit from a longer more descriptive name in the GUI app and on the contrary CLI apps should use shorter names with hyphens which are easier to type out.
I tried implementing Display for the subcommand enum, but noticed the macro creates a Commands which I cannot implement a custom display for. Thus, it seems I am stuck with only a single name for each command.
Describe the solution you'd like
This way I could use abbreviations for the cli applications, but the full names for gui applications.
#[derive(Debug,Parser)]pubenumSubcommand{#[command(name = "mcsf", display_name = "My Special Command Function")]MSCF{},#[command(name = "subcommand-a", display_name = "Subcommand A")]SubcommandA{},}
Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
The problem with this is we have nowhere else to use this display name within clap.
A workaround is we are exploring the idea of a plugin system where Command, Arg, etc effectively have an AnyMap so the user can attach any data they want and any library on top of clap can read it. An easy example of this is clap doesn't care about ValueHint but clap_complete does so we should move it out.
Our main priority atm is styling of help and errors. Next is either the plugin system or wrapping up some ArgGroup work.
Please complete the following tasks
Clap Version
4.1.1
Describe your use case
I am using
klask
to generateegui
applications directly fromclap
. This allows me to turn cli applications into native gui apps or webapps for people unfamiliar with the command line.However, I find that the names for subcommands benefit from a longer more descriptive name in the GUI app and on the contrary CLI apps should use shorter names with hyphens which are easier to type out.
I tried implementing
Display
for the subcommandenum
, but noticed the macro creates aCommand
s which I cannot implement a custom display for. Thus, it seems I am stuck with only a single name for each command.Describe the solution you'd like
This way I could use abbreviations for the cli applications, but the full names for gui applications.
Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: