fix(completion): update and fix completion to reflect new fgrep

pull/19/head
Kevin Zhuang 4 years ago
parent f9203b0824
commit 38535d0470

@ -16,25 +16,29 @@ mydir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${mydir}"/helper/set_variable.sh
function usage() {
echo -e "Usage: dotbare [-h] [-v] [COMMANDS] [OPTIONS] ...\n"
echo -e "Interactively manage dotfiles with the help of fzf and git bare repository."
echo -e "To see all dotbare specific COMMANDS, run dotbare without any arguments.\n"
echo -e "optional arguments:"
echo -e " -h, --help\t\tshow this help message and exit."
echo -e " -v, --version\t\tshow dotbare current version.\n"
echo -e "Available commands:"
echo -e " All git commands are available, treat dotbare as git."
echo -e " fadd \t\tstage files/directories interactively."
echo -e " freset \t\treset(unstage) files or commit interactively."
echo -e " funtrack \t\tuntrack files interactively."
echo -e " fstash \t\tmanage stash interactively."
echo -e " fcheckout \t\tcheckout branch/files/commit interactively."
echo -e " fstat \t\tinteractive menu to toggle stage/unstage."
echo -e " fedit \t\tinteractively select files/commit and edit."
echo -e " flog \t\tmanage commits interactively."
echo -e " fbackup \t\tperform backup for tracked files."
echo -e " fupgrade \t\tupdate dotbare to the latest master."
echo -e " finit \t\tinitialise dotbare or migrate dotfiles to a new machine."
echo -e "Usage: dotbare [-h] [-v] [COMMANDS] [OPTIONS] ...
Interactively manage dotfiles with the help of fzf and git bare repository.
To see all dotbare specific COMMANDS, run dotbare without any arguments.
Optional arguments:
-h, --help\t\tshow this help message and exit.
-v, --version\t\tshow dotbare current version.
Available commands:
All git commands are available, treat dotbare as git.
fadd \t\tstage files/directories interactively.
fbackup \t\tperform backup for tracked files.
fcheckout \t\tcheckout branch/files/commit interactively.
fedit \t\tinteractively select files/commit and edit.
fgrep \t\tgrep within tracked files.
finit \t\tinitialise dotbare or migrate dotfiles to a new machine.
flog \t\tmanage commits interactively.
freset \t\treset(unstage) files or commit interactively.
fstash \t\tmanage stash interactively.
fstat \t\tinteractive menu to toggle stage/unstage.
funtrack \t\tuntrack files interactively.
fupgrade \t\tupdate dotbare to the latest master."
}
# if no argument, display all possible actions

@ -26,6 +26,7 @@ __dotbare_completion() {
'fbackup:backup files'
'fcheckout:checkout file/branch/commit'
'fedit:edit files'
'fgrep:grep within tracked files'
'finit:init/migrate dotbare'
'flog:interactive log viewer'
'freset:reset files/commit'
@ -70,6 +71,11 @@ __dotbare_completion() {
'(-c --commit -m --modified -h --help)'{-c,--commit}'[edit commits]' \
&& ret=0
;;
fgrep)
_arguments \
'(- : *)'{-h,--help}'[show help information]' \
&& ret=0
;;
finit)
_arguments \
'(- : *)'{-h,--help}'[show help information]' \

@ -18,7 +18,7 @@ source "${mydir}"/../helper/git_query.sh
function usage() {
echo -e "Usage: dotbare fgrep [-h] ...
Grep words within tracked files and select to edit them through fzf.
Optional arguments:

Loading…
Cancel
Save