Skip to content

Commit

Permalink
feat(add): Add examples to --help output (#1612)
Browse files Browse the repository at this point in the history
Fixes #1608
  • Loading branch information
Janpot authored and evocateur committed Aug 28, 2018
1 parent bd948cc commit 2ab62c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions commands/add/README.md
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
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

0 comments on commit 2ab62c1

Please sign in to comment.