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

feat(add): Add examples to --help output #1612

Merged
merged 1 commit into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions commands/add/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Add the new package with an exact version (e.g., `1.0.1`) rather than the defaul
## Examples

```sh
# Adds the module-1 package to the packages in the 'prefix-' prefixed folders
lerna add module-1 packages/prefix-*

# Install module-1 to module-2
lerna add module-1 --scope=module-2

Expand Down
10 changes: 9 additions & 1 deletion commands/add/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ exports.builder = yargs => {
alias: "E",
describe: "Save version exactly",
},
});
})
.example(
"$0 add module-1 packages/prefix-*",
"Adds the module-1 package to the packages in the 'prefix-' prefixed folders"
)
.example("$0 add module-1 --scope=module-2", "Install module-1 to module-2")
.example("$0 add module-1 --scope=module-2 --dev", "Install module-1 to module-2 in devDependencies")
.example("$0 add module-1", "Install module-1 in all modules except module-1")
.example("$0 add babel-core", "Install babel-core in all modules");

return filterable(yargs);
};
Expand Down