Skip to content

Commit

Permalink
Add aliases aligned with standard binary names (mongod, mongo, `m…
Browse files Browse the repository at this point in the history
…ongos`) and `m lls` as an alias for `m installed`).
  • Loading branch information
stennie committed Jul 5, 2018
1 parent d822893 commit 833ae06
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ Output from `m --help`:
-h, --help Display help information
Aliases:
which bin
use as
shard sd
list ls
custom c
shell s
which bin
use as, mongod
shard sd, mongos
list ls
installed lls
custom c
shell s, sh, mongo
```

## Details
Expand All @@ -201,7 +201,7 @@ selected using of the variations in the _Binary Usage_ section above.

## Inspiration

Yes tj, this is nearly identical to [n](https://github.com/visionmedia/n). Huge thanks!
Yes tj, this is nearly identical to [n](https://github.com/tj/n). Huge thanks!

## Disclaimer

Expand Down
21 changes: 11 additions & 10 deletions bin/m
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ display_help() {
Aliases:
which bin
use as
shard sd
list ls
custom c
shell s
which bin
use as, mongod
shard sd, mongos
list ls
installed lls
custom c
shell s, sh, mongo
help
exit 0
Expand Down Expand Up @@ -829,13 +830,13 @@ else
case $1 in
-V|--version) display_m_version ;;
-h|--help|help) display_help ;;
installed) display_versions $2; exit ;;
lls|installed) display_versions $2; exit ;;
--latest) display_latest_version $2; exit ;;
--stable) display_latest_stable_version $2; exit ;;
bin|which) display_bin_path_for_version $2; exit ;;
as|use) shift; execute_with_version $@; exit ;;
sd|shard) shift; execute_shard_with_version $@; exit ;;
s|shell) shift; execute_shell_with_version $@; exit ;;
as|use|mongod) shift; execute_with_version $@; exit ;;
sd|shard|mongos) shift; execute_shard_with_version $@; exit ;;
s|sh|shell|mongo) shift; execute_shell_with_version $@; exit ;;
rm) shift; remove_versions $@; exit ;;
latest) install_mongo `$0 --latest`; exit ;;
stable) install_mongo `$0 --stable`; exit ;;
Expand Down

0 comments on commit 833ae06

Please sign in to comment.