mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
display help for commands that have Summary but not Usage
A command doesn't have to specify Usage docs if it doesn't accept any arguments. The default usage for a command will be printed as: Usage: rbenv ${command}
This commit is contained in:
parent
57df945738
commit
2b21e22e97
2 changed files with 6 additions and 3 deletions
|
@ -97,8 +97,12 @@ print_help() {
|
||||||
eval "$(documentation_for "$command")"
|
eval "$(documentation_for "$command")"
|
||||||
[ -n "$help" ] || help="$summary"
|
[ -n "$help" ] || help="$summary"
|
||||||
|
|
||||||
if [ -n "$usage" ]; then
|
if [ -n "$usage" -o -n "$summary" ]; then
|
||||||
echo "$usage"
|
if [ -n "$usage" ]; then
|
||||||
|
echo "$usage"
|
||||||
|
else
|
||||||
|
echo "Usage: rbenv ${command}"
|
||||||
|
fi
|
||||||
if [ -n "$help" ]; then
|
if [ -n "$help" ]; then
|
||||||
echo
|
echo
|
||||||
echo "$help"
|
echo "$help"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Summary: Rehash rbenv shims (run this after installing binaries)
|
# Summary: Rehash rbenv shims (run this after installing binaries)
|
||||||
# Usage: rbenv rehash
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$RBENV_DEBUG" ] && set -x
|
[ -n "$RBENV_DEBUG" ] && set -x
|
||||||
|
|
Loading…
Reference in a new issue