-
Notifications
You must be signed in to change notification settings - Fork 607
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
[rush] Improve command-line for "rush add" #1160
Comments
It's a limitation of the ts-command-line library. #790 is a similar issue. For a long time we've been meaning to replace the underlying parser that ts-command-line uses, but it hasn't been prioritized because we actually don't receive a lot of complaints about it compared to other things. :-) |
Can I add another complaint them :) this has been a pain for myself also. The -p flag seems pretty redundant. And having to rush add -p foo then wait, then add another, when you have 5 packages or so to add! |
You can skip the waiting by using # Skip updates
$ rush add -p lib1 -s
$ rush add -p lib2 -s
$ rush add -p lib3 -s
$ rush add -p lib4 -s
# Perform one update for all 5 additions
$ rush add -p lib5 BTW without any changes to ts-command-line, we could convert $ rush add -p lib1 -p lib2 -p lib3 -p lib4 -p lib5
Damn... You guys are really making me want to fix the ts-command-line backend parser, though! Today it's based on argparse which hasn't been updated in over a year... |
Well, this is extremely annoying now to add multiple packages through the It looks like this:
which is very cumbersome. It would be nice to do just:
Also, why I believe it would be very beneficial to have a CLI syntax compatible to |
running into this multiple times a day, it can be a bit jarring if having to switch between different package managers. Using bash function as workaround for now
|
I'm not opposed to If we want to get something implemented quickly, it would be simpler to extend the current design like this:
That would just involve changing this: rushstack/apps/rush-lib/src/cli/actions/AddAction.ts Lines 48 to 58 in 8c492e9
...to be a CommandLineStringListParameter instead of CommandLineStringParameter , and then add a for-loop somewhere to process each of the names.
Should be a pretty easy PR, and without any open questions for the design spec as far as I can tell. This would get something implemented quickly, and then we could come back and improve the CLI in a separate PR. |
Not sure why
rush add
takes packages through the-p
flag and not just naked parameters like all the package managers do, but it should still be able to install/update version of multiple package identifiers at once, for example with multiple flags:-p PACKAGE -p PACKAGE@VERSION
.The current behavior when you supply
rush add -p foo -p bar
is particularly surprising - instead of erroring out since this isn't supported, it just ignores the package names before the last one supplied. You end up only addingbar
. That's probably a Bad Thing™The text was updated successfully, but these errors were encountered: