Make the usage syntax for arbitrary args consistent (#1447)
This commit is contained in:
parent
172a79e993
commit
3e5347be1e
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Usage: rbenv completions <command> [arg1 arg2...]
|
# Usage: rbenv completions <command> [<args>...]
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$RBENV_DEBUG" ] && set -x
|
[ -n "$RBENV_DEBUG" ] && set -x
|
||||||
|
@ -157,7 +157,7 @@ if [ -z "$1" ] || [ "$1" == "rbenv" ]; then
|
|||||||
if [ -z "$usage" ] && [ -t 1 ] && type -P man >/dev/null; then
|
if [ -z "$usage" ] && [ -t 1 ] && type -P man >/dev/null; then
|
||||||
MANPATH="${BASH_SOURCE%/*}/../share/man:$MANPATH" exec man rbenv
|
MANPATH="${BASH_SOURCE%/*}/../share/man:$MANPATH" exec man rbenv
|
||||||
fi
|
fi
|
||||||
echo "Usage: rbenv <command> [<args>]"
|
echo "Usage: rbenv <command> [<args>...]"
|
||||||
[ -n "$usage" ] && exit
|
[ -n "$usage" ] && exit
|
||||||
echo
|
echo
|
||||||
echo "Some useful rbenv commands are:"
|
echo "Some useful rbenv commands are:"
|
||||||
|
@ -5,14 +5,14 @@ load test_helper
|
|||||||
@test "without args shows summary of common commands" {
|
@test "without args shows summary of common commands" {
|
||||||
run rbenv-help
|
run rbenv-help
|
||||||
assert_success
|
assert_success
|
||||||
assert_line "Usage: rbenv <command> [<args>]"
|
assert_line "Usage: rbenv <command> [<args>...]"
|
||||||
assert_line "Some useful rbenv commands are:"
|
assert_line "Some useful rbenv commands are:"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "usage flag" {
|
@test "usage flag" {
|
||||||
run rbenv-help --usage
|
run rbenv-help --usage
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "Usage: rbenv <command> [<args>]"
|
assert_output "Usage: rbenv <command> [<args>...]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "invalid command" {
|
@test "invalid command" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user