-
Notifications
You must be signed in to change notification settings - Fork 232
Add --directory option #2876
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
Add --directory option #2876
Conversation
lib/src/command/add.dart
Outdated
@@ -74,6 +74,8 @@ class AddCommand extends PubCommand { | |||
|
|||
argParser.addFlag('precompile', | |||
help: 'Precompile executables in immediate dependencies.'); | |||
argParser.addOption('directory', | |||
abbr: 'C', help: 'Run this in <dir>.', valueHelp: 'dir'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abbr: 'C', help: 'Run this in <dir>.', valueHelp: 'dir'); | |
abbr: 'C', help: 'Run in the directory <dir>.', valueHelp: 'dir'); |
lib/src/command_runner.dart
Outdated
argParser.addOption( | ||
'directory', | ||
abbr: 'C', | ||
help: 'Run the subcommand in <dir>.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I suggest Run in the directory <dir>.
@@ -109,6 +112,13 @@ class PubCommandRunner extends CommandRunner<int> implements PubTopLevel { | |||
}); | |||
argParser.addFlag('verbose', | |||
abbr: 'v', negatable: false, help: 'Shortcut for "--verbosity=all".'); | |||
argParser.addOption( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, does it have to both be a top-level argument, and an argument in all the subcommands?
What happens if it's passed twice...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - it doesn't have to. That just made more sense to me. I would personally instinctively give it at the top-level (it is an option that changes how the following command is interpreted), but it would be annoying to have not work for each command.
We could do it either way if you think it is better.
Fixes: #2864