fix(main): fix main script's no argument wrong help display

pull/13/head
kevin zhuang 4 years ago
parent ca9bf74d04
commit aaed8ee1bc

@ -41,8 +41,8 @@ function usage() {
if [[ "$#" -eq 0 ]]; then
find "${mydir}"/scripts/* -type f -print0 \
| xargs -I __ -0 basename __ \
| fzf --no-multi --header='Available commands' --preview="dotbare {} -h" \
| xargs -I __ dotbare __ -h
| fzf --no-multi --header='Available commands' --preview="${mydir}/dotbare {} -h" \
| xargs -I __ "${mydir}"/dotbare __ -h
exit 0
fi

@ -8,9 +8,9 @@ mydir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function usage() {
echo -e "Usage: dotbare fupgrade [-h] ...\n"
echo -e "Upgrade dotbare to the latest master\n"
echo -e "Upgrade dotbare to the latest master.\n"
echo -e "optional arguments:"
echo -e " -h, --help\t\tshow this help message and exit"
echo -e " -h, --help\t\tshow this help message and exit."
}
while [[ "$#" -gt 0 ]]; do

Loading…
Cancel
Save