clap-rs / clap

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
14.31k stars 1.05k forks source link

[feature request] customizable subcommand separator besides space #1420

Open samuela opened 5 years ago

samuela commented 5 years ago

Many CLIs use colons to separate subcommands instead of spaces, eg. heroku auth:login, heroku auth:logout, etc. It would be nice to have support for this sort of thing in clap as well. It becomes especially important when maintaining backwards compatibility with CLIs written in this format.

epage commented 2 years ago

So it sounds like you want to have heroku auth:login act like heroku auth logic today? Is there a reason to do this instead of just defining an auth:login subcommand? For help management?

samuela commented 2 years ago

Yeah, it's not a huge deal writing a CLI from scratch. Just a bit of an issue if you want to rewrite an existing CLI with clap.

epage commented 2 years ago

I think what I'm missing is what the challenge is in porting an existing CLI to clap. In what way would a auth:login subcommand not work?

samuela commented 2 years ago

Honestly it's been a while since I was working on this, so I don't recall at this point. Things may have also changed with clap in the meantime that would obviate the need for this feature request.

pksunkara commented 2 years ago

I think the intention is to treat auth as a command and then it having it's own subcommands (maybe for better organization in the help messages?).