main script usage

pull/3/head
kevin zhuang 4 years ago
parent 5382501dac
commit 34ae617084

@ -17,11 +17,32 @@ mydir="${0%/*}"
source "${mydir}"/helper/set_variable.sh
function usage() {
echo "help"
echo -e "Usage: dotbare [-h] [COMMANDS] [OPTIONS] ...\n"
echo -e "Interactively manage dotfiles with the help of fzf and git bare repo"
echo -e "To see all dotbare specific COMMANDS, run dotbare without any arguments\n"
echo -e "dotbare is just a wrapper around git hence all git commands will function"
echo -e "normally, just replace git with dotbare (e.g. dotbare commit -m 'message')."
echo -e "dotbare added couple useful scripts starting with 'f' prefix to help you"
echo -e "manage your interact with your git bare repo a little easier with the help of fzf\n"
echo -e "optional arguments:"
echo -e " -h\t\tshow this help message and exit"
echo -e "Available commands:"
echo -e " Any git commands, treat dotbare as git"
echo -e " fadd: \tstage modified file interactively"
echo -e " funtrack: \tuntrack file interactively"
echo -e " fstash: \tmanage stash interactively"
echo -e " fcheckout: \tcheckout branch/files/commits interactively"
echo -e " fstat: \tstage/unstage interactively"
echo -e " fedit: \tselect files/commits and edit interactively"
echo -e " flog: \tmanage commits interactively"
echo -e " fbackup: \tperform backup for tracked dotfiles"
echo -e " help: \tshow this help message and exit"
}
# if no argument passed in, let git display help message
# if no argument, display all possible actions
# disbale shell check for ls, we are not processing
if [[ $# -eq 0 ]]; then
# shellcheck disable=SC2012
ls "${mydir}"/scripts \
| fzf --no-multi --header='Available commands' --preview="dotbare {} -h" \
| xargs -I __ dotbare __ -h

Loading…
Cancel
Save