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

Added short-flags for yarn add #1618

Merged
merged 2 commits into from
Nov 3, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/cli/commands/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ export class Add extends Install {

export function setFlags(commander: Object) {
commander.usage('add [packages ...] [flags]');
commander.option('--dev', 'save package to your `devDependencies`');
commander.option('--peer', 'save package to your `peerDependencies`');
commander.option('--optional', 'save package to your `optionalDependencies`');
commander.option('--exact', 'install exact version');
commander.option('--tilde', 'install most recent release with the same minor version');
commander.option('--dev', '-D', 'save package to your `devDependencies`');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proper signature for this method is commander.option("--dev, -D", description);.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it.
Thanks for your feedback!

commander.option('--peer', '-P', 'save package to your `peerDependencies`');
commander.option('--optional', '-O', 'save package to your `optionalDependencies`');
commander.option('--exact', 'E', 'install exact version');
commander.option('--tilde', '-T', 'install most recent release with the same minor version');
}

export async function run(
Expand Down