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

Command line revamp #4225

Closed
arcanis opened this issue Aug 22, 2017 · 6 comments
Closed

Command line revamp #4225

arcanis opened this issue Aug 22, 2017 · 6 comments

Comments

@arcanis
Copy link
Member

arcanis commented Aug 22, 2017

The current codebase uses Commander. Problem is that we have a lot of custom hacks to support constructs not supported natively by Commander. It degrades the user experience since our hacks don't support all the constructs they should. Some examples:

# Command doesn't support nested subcommands, so we implement it manually
$> yarn global add 

# Yarn thinks this is an install command because the command name isn't the first parameter
$> yarn -v add <pkg> 

# The '--opt' option is parsed as being part of the 'run' command instead of being forwarded
$> yarn run <pkg> --opt

It would be nice to change our parser to something that would prevent us from having to write such hacks inside Yarn. Some options (I haven't made research on all of them yet):

I'm kinda partial to the last one, in no small part because I wrote it 😄 It would allow us to quickly contribute changes and make releases if we want to support new features, rather than implementing them inside Yarn like we did with commander. It also should support most features we need (promises tolerant, re-entrant, nested subcommands, options forwarding, default help message).

@Haroenv
Copy link
Member

Haroenv commented Aug 22, 2017

I'd love to have yarn search be a real command but it was a bit tricky when I tried to do as-you-type autocomplete in terminal. Is this something we see as possible with?

@arcanis
Copy link
Member Author

arcanis commented Aug 23, 2017

I think Yargs supports automatic completion of bash options. Concierge doesn't yet, but it could be easily adapted.

@Haroenv
Copy link
Member

Haroenv commented Aug 23, 2017

I meant a full autocomplete like on the yarn website, but then in terminal

@arcanis
Copy link
Member Author

arcanis commented Aug 23, 2017

Oh - that's something that would require an actual UI, right? I think that would be easily doable with mylittledom, but it might be too heavy to be a default command. Here's an example.

@shadowspawn
Copy link

Commander supports nested subcommands from v5.

@arcanis
Copy link
Member Author

arcanis commented Aug 5, 2020

Fwiw we have since then started to use Clipanion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants