1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2026-03-02 03:49:29 +00:00

Add --version and --help as yadm internal commands (#267)

This commit is contained in:
Tim Byrne
2020-12-21 16:53:44 -06:00
parent e3d2ea2863
commit c4b419d98e
4 changed files with 13 additions and 8 deletions

5
yadm
View File

@@ -93,13 +93,14 @@ function main() {
# parse command line arguments
local retval=0
internal_commands="^(alt|bootstrap|clean|clone|config|decrypt|encrypt|enter|git-crypt|help|init|introspect|list|perms|transcrypt|upgrade|version)$"
internal_commands="^(alt|bootstrap|clean|clone|config|decrypt|encrypt|enter|git-crypt|help|--help|init|introspect|list|perms|transcrypt|upgrade|version|--version)$"
if [ -z "$*" ] ; then
# no argumnts will result in help()
help
elif [[ "$1" =~ $internal_commands ]] ; then
# for internal commands, process all of the arguments
YADM_COMMAND="${1/-/_}"
YADM_COMMAND="${1//-/_}"
YADM_COMMAND="${YADM_COMMAND/__/}"
YADM_ARGS=()
shift