mirror of https://git.envs.net/envs/burrow.git
switch -v to -d and added new version info
This commit is contained in:
parent
bb609ca0e3
commit
532e067463
16
burrow
16
burrow
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# v1.0.0rc
|
version="v1.0.0rc"
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
configfiles="$HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow"
|
configfiles="$HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow"
|
||||||
editor=${EDITOR:-vi}
|
editor=${EDITOR:-vi}
|
||||||
|
@ -16,7 +16,7 @@ config_git_commit=false
|
||||||
config_git_push=false
|
config_git_push=false
|
||||||
|
|
||||||
# vars from flags
|
# vars from flags
|
||||||
flag_verbose=0
|
flag_debug=0
|
||||||
|
|
||||||
# vars from args
|
# vars from args
|
||||||
arg_recipe=0
|
arg_recipe=0
|
||||||
|
@ -35,8 +35,9 @@ create-config - create a default configuration file
|
||||||
update-git - silently pulls gopher git repo if it exists
|
update-git - silently pulls gopher git repo if it exists
|
||||||
|
|
||||||
OPTIONAL FLAGS:
|
OPTIONAL FLAGS:
|
||||||
help [-h] - show this help
|
-h - show this help
|
||||||
verbose [-v] - verbose logging
|
-v - show current version info
|
||||||
|
-d - debug mode
|
||||||
|
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
|
@ -50,14 +51,15 @@ popd () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseopts() {
|
function parseopts() {
|
||||||
while getopts ":hv" opt
|
while getopts ":hvd" opt
|
||||||
do
|
do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
h)
|
h)
|
||||||
show_help
|
show_help
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
v) flag_verbose=1 ;;
|
d) flag_debug=1 ;;
|
||||||
|
v) echo "$version" ;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid option. Try -h for help."
|
echo "Invalid option. Try -h for help."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -280,7 +282,7 @@ function main() {
|
||||||
parseopts "$@"
|
parseopts "$@"
|
||||||
parseargs "${@:$?}"
|
parseargs "${@:$?}"
|
||||||
|
|
||||||
if [[ ${flag_verbose} -gt 0 ]]
|
if [[ ${flag_debug} -gt 0 ]]
|
||||||
then
|
then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue