Merge branch 'fix-subcommand-select' into main

Fix merge conflict in docopt generation + change log entry.
This commit is contained in:
decentral1se 2021-03-20 21:18:34 +01:00
commit ece5385a38
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A
2 changed files with 112 additions and 100 deletions

View File

@ -7,6 +7,7 @@
- Show context connection details on `abra server ls` ([#110](https://git.autonomic.zone/coop-cloud/abra/issues/110)) - Show context connection details on `abra server ls` ([#110](https://git.autonomic.zone/coop-cloud/abra/issues/110))
- Allow to debug the SSH connection details on swarm init ([#109](https://git.autonomic.zone/coop-cloud/abra/issues/109)) - Allow to debug the SSH connection details on swarm init ([#109](https://git.autonomic.zone/coop-cloud/abra/issues/109))
- Show correct status for apps deployed on servers with missing context ([#99](https://git.autonomic.zone/coop-cloud/abra/issues/99)) - Show correct status for apps deployed on servers with missing context ([#99](https://git.autonomic.zone/coop-cloud/abra/issues/99))
- Search for subcommands in descending order of how many components there are ([#108](https://git.autonomic.zone/coop-cloud/abra/issues/108))
# abra 0.6.0 (2021-03-17) # abra 0.6.0 (2021-03-17)

211
abra
View File

@ -20,6 +20,7 @@ Usage:
abra [options] app <app> backup (<service>|--all) abra [options] app <app> backup (<service>|--all)
abra [options] app <app> deploy [--update] [--force] abra [options] app <app> deploy [--update] [--force]
abra [options] app <app> check abra [options] app <app> check
abra [options] app <app> version
abra [options] app <app> config abra [options] app <app> config
abra [options] app <app> cp <src> <dst> abra [options] app <app> cp <src> <dst>
abra [options] app <app> logs [<service>] abra [options] app <app> logs [<service>]
@ -157,85 +158,85 @@ eval "var_$1+=($value)"; else eval "var_$1=$value"; fi; return 0; fi; done
return 1; }; stdout() { printf -- "cat <<'EOM'\n%s\nEOM\n" "$1"; }; stderr() { return 1; }; stdout() { printf -- "cat <<'EOM'\n%s\nEOM\n" "$1"; }; stderr() {
printf -- "cat <<'EOM' >&2\n%s\nEOM\n" "$1"; }; error() { printf -- "cat <<'EOM' >&2\n%s\nEOM\n" "$1"; }; error() {
[[ -n $1 ]] && stderr "$1"; stderr "$usage"; _return 1; }; _return() { [[ -n $1 ]] && stderr "$1"; stderr "$usage"; _return 1; }; _return() {
printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:2037} printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:2072}
usage=${DOC:40:1501}; digest=a1dde usage=${DOC:40:1536}; digest=9142c
shorts=(-U -e -h -s -v -b -d -C '' '' '' '' '' '' '' '' '' '' '' '' '' '') shorts=(-U -v -s -h -C -b -d -e '' '' '' '' '' '' '' '' '' '' '' '' '' '')
longs=(--skip-update --env --help --stack --verbose --branch --debug --skip-check --status --server --type --domain --app-name --pass --secrets --all --update --force --volumes --no-tty --user --dev) longs=(--skip-update --verbose --stack --help --skip-check --branch --debug --env --status --server --type --domain --app-name --pass --secrets --all --update --force --volumes --no-tty --user --dev)
argcounts=(0 1 0 1 0 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 0); node_0(){ argcounts=(0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 1 0); node_0(){
switch __skip_update 0; }; node_1(){ value __env 1; }; node_2(){ switch __help 2 switch __skip_update 0; }; node_1(){ switch __verbose 1; }; node_2(){
}; node_3(){ value __stack 3; }; node_4(){ switch __verbose 4; }; node_5(){ value __stack 2; }; node_3(){ switch __help 3; }; node_4(){
value __branch 5; }; node_6(){ switch __debug 6; }; node_7(){ switch __skip_check 4; }; node_5(){ value __branch 5; }; node_6(){
switch __skip_check 7; }; node_8(){ switch __status 8; }; node_9(){ switch __debug 6; }; node_7(){ value __env 7; }; node_8(){ switch __status 8; }
value __server 9; }; node_10(){ value __type 10; }; node_11(){ value __domain 11 node_9(){ value __server 9; }; node_10(){ value __type 10; }; node_11(){
}; node_12(){ value __app_name 12; }; node_13(){ switch __pass 13; }; node_14(){ value __domain 11; }; node_12(){ value __app_name 12; }; node_13(){
switch __secrets 14; }; node_15(){ switch __all 15; }; node_16(){ switch __pass 13; }; node_14(){ switch __secrets 14; }; node_15(){
switch __update 16; }; node_17(){ switch __force 17; }; node_18(){ switch __all 15; }; node_16(){ switch __update 16; }; node_17(){
switch __volumes 18; }; node_19(){ switch __no_tty 19; }; node_20(){ switch __force 17; }; node_18(){ switch __volumes 18; }; node_19(){
value __user 20; }; node_21(){ switch __dev 21; }; node_22(){ value _type_ a; } switch __no_tty 19; }; node_20(){ value __user 20; }; node_21(){ switch __dev 21
node_23(){ value _app_ a; }; node_24(){ value _service_ a; }; node_25(){ }; node_22(){ value _type_ a; }; node_23(){ value _app_ a; }; node_24(){
value _src_ a; }; node_26(){ value _dst_ a; }; node_27(){ value _backup_file_ a value _service_ a; }; node_25(){ value _src_ a; }; node_26(){ value _dst_ a; }
}; node_28(){ value _args_ a true; }; node_29(){ value _secret_ a; }; node_30(){ node_27(){ value _backup_file_ a; }; node_28(){ value _args_ a true; }
value _version_ a; }; node_31(){ value _cmd_ a; }; node_32(){ value _data_ a; } node_29(){ value _secret_ a; }; node_30(){ value _version_ a; }; node_31(){
node_33(){ value _command_ a; }; node_34(){ value _host_ a; }; node_35(){ value _cmd_ a; }; node_32(){ value _data_ a; }; node_33(){ value _command_ a; }
value _user_ a; }; node_36(){ value _port_ a; }; node_37(){ value _provider_ a node_34(){ value _host_ a; }; node_35(){ value _user_ a; }; node_36(){
}; node_38(){ value _subcommands_ a true; }; node_39(){ _command app; } value _port_ a; }; node_37(){ value _provider_ a; }; node_38(){
node_40(){ _command list; }; node_41(){ _command ls; }; node_42(){ _command new value _subcommands_ a true; }; node_39(){ _command app; }; node_40(){
}; node_43(){ _command backup; }; node_44(){ _command deploy; }; node_45(){ _command list; }; node_41(){ _command ls; }; node_42(){ _command new; }
_command check; }; node_46(){ _command config; }; node_47(){ _command cp; } node_43(){ _command backup; }; node_44(){ _command deploy; }; node_45(){
node_48(){ _command logs; }; node_49(){ _command ps; }; node_50(){ _command check; }; node_46(){ _command version; }; node_47(){ _command config; }
_command restore; }; node_51(){ _command rm; }; node_52(){ _command delete; } node_48(){ _command cp; }; node_49(){ _command logs; }; node_50(){ _command ps
node_53(){ _command run; }; node_54(){ _command rollback; }; node_55(){ }; node_51(){ _command restore; }; node_52(){ _command rm; }; node_53(){
_command secret; }; node_56(){ _command generate; }; node_57(){ _command insert _command delete; }; node_54(){ _command run; }; node_55(){ _command rollback; }
}; node_58(){ _command undeploy; }; node_59(){ _command server; }; node_60(){ node_56(){ _command secret; }; node_57(){ _command generate; }; node_58(){
_command add; }; node_61(){ _command init; }; node_62(){ _command apps; } _command insert; }; node_59(){ _command undeploy; }; node_60(){ _command server
node_63(){ _command upgrade; }; node_64(){ _command version; }; node_65(){ }; node_61(){ _command add; }; node_62(){ _command init; }; node_63(){
_command help; }; node_66(){ optional 0 1 2 3 4 5 6 7; }; node_67(){ optional 66 _command apps; }; node_64(){ _command upgrade; }; node_65(){ _command help; }
}; node_68(){ either 40 41; }; node_69(){ required 68; }; node_70(){ optional 8 node_66(){ optional 0 1 2 3 4 5 6 7; }; node_67(){ optional 66; }; node_68(){
}; node_71(){ optional 9; }; node_72(){ optional 10; }; node_73(){ either 40 41; }; node_69(){ required 68; }; node_70(){ optional 8; }; node_71(){
required 67 39 69 70 71 72; }; node_74(){ optional 11; }; node_75(){ optional 12 optional 9; }; node_72(){ optional 10; }; node_73(){ required 67 39 69 70 71 72
}; node_76(){ optional 13; }; node_77(){ optional 14; }; node_78(){ }; node_74(){ optional 11; }; node_75(){ optional 12; }; node_76(){ optional 13
required 67 39 42 71 74 75 76 77 22; }; node_79(){ either 24 15; }; node_80(){ }; node_77(){ optional 14; }; node_78(){ required 67 39 42 71 74 75 76 77 22; }
required 79; }; node_81(){ required 67 39 23 43 80; }; node_82(){ optional 16; } node_79(){ either 24 15; }; node_80(){ required 79; }; node_81(){
node_83(){ optional 17; }; node_84(){ required 67 39 23 44 82 83; }; node_85(){ required 67 39 23 43 80; }; node_82(){ optional 16; }; node_83(){ optional 17; }
required 67 39 23 45; }; node_86(){ required 67 39 23 46; }; node_87(){ node_84(){ required 67 39 23 44 82 83; }; node_85(){ required 67 39 23 45; }
required 67 39 23 47 25 26; }; node_88(){ optional 24; }; node_89(){ node_86(){ required 67 39 23 46; }; node_87(){ required 67 39 23 47; }
required 67 39 23 48 88; }; node_90(){ required 67 39 23 49; }; node_91(){ node_88(){ required 67 39 23 48 25 26; }; node_89(){ optional 24; }; node_90(){
required 67 39 23 50 80; }; node_92(){ either 51 52; }; node_93(){ required 92 required 67 39 23 49 89; }; node_91(){ required 67 39 23 50; }; node_92(){
}; node_94(){ optional 18; }; node_95(){ required 67 39 23 93 83 94 77; } required 67 39 23 51 80; }; node_93(){ either 52 53; }; node_94(){ required 93
node_96(){ optional 27; }; node_97(){ required 67 39 23 50 24 96; }; node_98(){ }; node_95(){ optional 18; }; node_96(){ required 67 39 23 94 83 95 77; }
optional 19; }; node_99(){ optional 20; }; node_100(){ oneormore 28; } node_97(){ optional 27; }; node_98(){ required 67 39 23 51 24 97; }; node_99(){
node_101(){ required 67 39 23 53 98 99 24 100; }; node_102(){ optional 19; }; node_100(){ optional 20; }; node_101(){ oneormore 28; }
required 67 39 23 54 24; }; node_103(){ required 29 30; }; node_104(){ node_102(){ required 67 39 23 54 99 100 24 101; }; node_103(){
either 103 15; }; node_105(){ required 104; }; node_106(){ optional 31; } required 67 39 23 55 24; }; node_104(){ required 29 30; }; node_105(){
node_107(){ required 67 39 23 55 56 105 106 76; }; node_108(){ either 104 15; }; node_106(){ required 105; }; node_107(){ optional 31; }
required 67 39 23 55 57 29 30 32 76; }; node_109(){ either 29 15; }; node_110(){ node_108(){ required 67 39 23 56 57 106 107 76; }; node_109(){
required 109; }; node_111(){ required 67 39 23 55 93 110 76 83; }; node_112(){ required 67 39 23 56 58 29 30 32 76; }; node_110(){ either 29 15; }; node_111(){
required 67 39 23 58 83; }; node_113(){ optional 100; }; node_114(){ required 110; }; node_112(){ required 67 39 23 56 94 111 76 83; }; node_113(){
required 67 39 23 33 113; }; node_115(){ optional 35; }; node_116(){ optional 36 required 67 39 23 59 83; }; node_114(){ optional 101; }; node_115(){
}; node_117(){ required 67 59 60 34 115 116; }; node_118(){ required 67 59 42 37 required 67 39 23 33 114; }; node_116(){ optional 35; }; node_117(){ optional 36
}; node_119(){ required 67 59 69; }; node_120(){ required 67 59 34 51; } }; node_118(){ required 67 60 61 34 116 117; }; node_119(){ required 67 60 42 37
node_121(){ required 67 59 34 61; }; node_122(){ required 67 59 34 62 70; } }; node_120(){ required 67 60 69; }; node_121(){ required 67 60 34 52; }
node_123(){ optional 21; }; node_124(){ required 67 63 123; }; node_125(){ node_122(){ required 67 60 34 62; }; node_123(){ required 67 60 34 63 70; }
required 67 64; }; node_126(){ oneormore 38; }; node_127(){ optional 126; } node_124(){ optional 21; }; node_125(){ required 67 64 124; }; node_126(){
node_128(){ required 67 65 127; }; node_129(){ required 67; }; node_130(){ required 67 46; }; node_127(){ oneormore 38; }; node_128(){ optional 127; }
either 73 78 81 84 85 86 87 89 90 91 95 97 101 102 107 108 111 112 114 117 118 119 120 121 122 124 125 128 129 node_129(){ required 67 65 128; }; node_130(){ required 67; }; node_131(){
}; node_131(){ required 130; }; cat <<<' docopt_exit() { either 73 78 81 84 85 86 87 88 90 91 92 96 98 102 103 108 109 112 113 115 118 119 120 121 122 123 125 126 129 130
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1501}" >&2 }; node_132(){ required 131; }; cat <<<' docopt_exit() {
exit 1; }'; unset var___skip_update var___env var___help var___stack \ [[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1536}" >&2
var___verbose var___branch var___debug var___skip_check var___status \ exit 1; }'; unset var___skip_update var___verbose var___stack var___help \
var___server var___type var___domain var___app_name var___pass var___secrets \ var___skip_check var___branch var___debug var___env var___status var___server \
var___all var___update var___force var___volumes var___no_tty var___user \ var___type var___domain var___app_name var___pass var___secrets var___all \
var___dev var__type_ var__app_ var__service_ var__src_ var__dst_ \ var___update var___force var___volumes var___no_tty var___user var___dev \
var__backup_file_ var__args_ var__secret_ var__version_ var__cmd_ var__data_ \ var__type_ var__app_ var__service_ var__src_ var__dst_ var__backup_file_ \
var__command_ var__host_ var__user_ var__port_ var__provider_ \ var__args_ var__secret_ var__version_ var__cmd_ var__data_ var__command_ \
var__subcommands_ var_app var_list var_ls var_new var_backup var_deploy \ var__host_ var__user_ var__port_ var__provider_ var__subcommands_ var_app \
var_check var_config var_cp var_logs var_ps var_restore var_rm var_delete \ var_list var_ls var_new var_backup var_deploy var_check var_version var_config \
var_run var_rollback var_secret var_generate var_insert var_undeploy \ var_cp var_logs var_ps var_restore var_rm var_delete var_run var_rollback \
var_server var_add var_init var_apps var_upgrade var_version var_help var_secret var_generate var_insert var_undeploy var_server var_add var_init \
parse 131 "$@"; local prefix=${DOCOPT_PREFIX:-''} var_apps var_upgrade var_help; parse 132 "$@"; local prefix=${DOCOPT_PREFIX:-''}
unset "${prefix}__skip_update" "${prefix}__env" "${prefix}__help" \ unset "${prefix}__skip_update" "${prefix}__verbose" "${prefix}__stack" \
"${prefix}__stack" "${prefix}__verbose" "${prefix}__branch" "${prefix}__debug" \ "${prefix}__help" "${prefix}__skip_check" "${prefix}__branch" \
"${prefix}__skip_check" "${prefix}__status" "${prefix}__server" \ "${prefix}__debug" "${prefix}__env" "${prefix}__status" "${prefix}__server" \
"${prefix}__type" "${prefix}__domain" "${prefix}__app_name" "${prefix}__pass" \ "${prefix}__type" "${prefix}__domain" "${prefix}__app_name" "${prefix}__pass" \
"${prefix}__secrets" "${prefix}__all" "${prefix}__update" "${prefix}__force" \ "${prefix}__secrets" "${prefix}__all" "${prefix}__update" "${prefix}__force" \
"${prefix}__volumes" "${prefix}__no_tty" "${prefix}__user" "${prefix}__dev" \ "${prefix}__volumes" "${prefix}__no_tty" "${prefix}__user" "${prefix}__dev" \
@ -245,19 +246,19 @@ unset "${prefix}__skip_update" "${prefix}__env" "${prefix}__help" \
"${prefix}_command_" "${prefix}_host_" "${prefix}_user_" "${prefix}_port_" \ "${prefix}_command_" "${prefix}_host_" "${prefix}_user_" "${prefix}_port_" \
"${prefix}_provider_" "${prefix}_subcommands_" "${prefix}app" "${prefix}list" \ "${prefix}_provider_" "${prefix}_subcommands_" "${prefix}app" "${prefix}list" \
"${prefix}ls" "${prefix}new" "${prefix}backup" "${prefix}deploy" \ "${prefix}ls" "${prefix}new" "${prefix}backup" "${prefix}deploy" \
"${prefix}check" "${prefix}config" "${prefix}cp" "${prefix}logs" "${prefix}ps" \ "${prefix}check" "${prefix}version" "${prefix}config" "${prefix}cp" \
"${prefix}restore" "${prefix}rm" "${prefix}delete" "${prefix}run" \ "${prefix}logs" "${prefix}ps" "${prefix}restore" "${prefix}rm" \
"${prefix}rollback" "${prefix}secret" "${prefix}generate" "${prefix}insert" \ "${prefix}delete" "${prefix}run" "${prefix}rollback" "${prefix}secret" \
"${prefix}undeploy" "${prefix}server" "${prefix}add" "${prefix}init" \ "${prefix}generate" "${prefix}insert" "${prefix}undeploy" "${prefix}server" \
"${prefix}apps" "${prefix}upgrade" "${prefix}version" "${prefix}help" "${prefix}add" "${prefix}init" "${prefix}apps" "${prefix}upgrade" \
eval "${prefix}"'__skip_update=${var___skip_update:-false}' "${prefix}help"; eval "${prefix}"'__skip_update=${var___skip_update:-false}'
eval "${prefix}"'__env=${var___env:-}'
eval "${prefix}"'__help=${var___help:-false}'
eval "${prefix}"'__stack=${var___stack:-}'
eval "${prefix}"'__verbose=${var___verbose:-false}' eval "${prefix}"'__verbose=${var___verbose:-false}'
eval "${prefix}"'__stack=${var___stack:-}'
eval "${prefix}"'__help=${var___help:-false}'
eval "${prefix}"'__skip_check=${var___skip_check:-false}'
eval "${prefix}"'__branch=${var___branch:-}' eval "${prefix}"'__branch=${var___branch:-}'
eval "${prefix}"'__debug=${var___debug:-false}' eval "${prefix}"'__debug=${var___debug:-false}'
eval "${prefix}"'__skip_check=${var___skip_check:-false}' eval "${prefix}"'__env=${var___env:-}'
eval "${prefix}"'__status=${var___status:-false}' eval "${prefix}"'__status=${var___status:-false}'
eval "${prefix}"'__server=${var___server:-}' eval "${prefix}"'__server=${var___server:-}'
eval "${prefix}"'__type=${var___type:-}' eval "${prefix}"'__type=${var___type:-}'
@ -294,6 +295,7 @@ eval "${prefix}"'new=${var_new:-false}'
eval "${prefix}"'backup=${var_backup:-false}' eval "${prefix}"'backup=${var_backup:-false}'
eval "${prefix}"'deploy=${var_deploy:-false}' eval "${prefix}"'deploy=${var_deploy:-false}'
eval "${prefix}"'check=${var_check:-false}' eval "${prefix}"'check=${var_check:-false}'
eval "${prefix}"'version=${var_version:-false}'
eval "${prefix}"'config=${var_config:-false}' eval "${prefix}"'config=${var_config:-false}'
eval "${prefix}"'cp=${var_cp:-false}'; eval "${prefix}"'logs=${var_logs:-false}' eval "${prefix}"'cp=${var_cp:-false}'; eval "${prefix}"'logs=${var_logs:-false}'
eval "${prefix}"'ps=${var_ps:-false}' eval "${prefix}"'ps=${var_ps:-false}'
@ -311,12 +313,11 @@ eval "${prefix}"'add=${var_add:-false}'
eval "${prefix}"'init=${var_init:-false}' eval "${prefix}"'init=${var_init:-false}'
eval "${prefix}"'apps=${var_apps:-false}' eval "${prefix}"'apps=${var_apps:-false}'
eval "${prefix}"'upgrade=${var_upgrade:-false}' eval "${prefix}"'upgrade=${var_upgrade:-false}'
eval "${prefix}"'version=${var_version:-false}'
eval "${prefix}"'help=${var_help:-false}'; local docopt_i=1 eval "${prefix}"'help=${var_help:-false}'; local docopt_i=1
[[ $BASH_VERSION =~ ^4.3 ]] && docopt_i=2; for ((;docopt_i>0;docopt_i--)); do [[ $BASH_VERSION =~ ^4.3 ]] && docopt_i=2; for ((;docopt_i>0;docopt_i--)); do
declare -p "${prefix}__skip_update" "${prefix}__env" "${prefix}__help" \ declare -p "${prefix}__skip_update" "${prefix}__verbose" "${prefix}__stack" \
"${prefix}__stack" "${prefix}__verbose" "${prefix}__branch" "${prefix}__debug" \ "${prefix}__help" "${prefix}__skip_check" "${prefix}__branch" \
"${prefix}__skip_check" "${prefix}__status" "${prefix}__server" \ "${prefix}__debug" "${prefix}__env" "${prefix}__status" "${prefix}__server" \
"${prefix}__type" "${prefix}__domain" "${prefix}__app_name" "${prefix}__pass" \ "${prefix}__type" "${prefix}__domain" "${prefix}__app_name" "${prefix}__pass" \
"${prefix}__secrets" "${prefix}__all" "${prefix}__update" "${prefix}__force" \ "${prefix}__secrets" "${prefix}__all" "${prefix}__update" "${prefix}__force" \
"${prefix}__volumes" "${prefix}__no_tty" "${prefix}__user" "${prefix}__dev" \ "${prefix}__volumes" "${prefix}__no_tty" "${prefix}__user" "${prefix}__dev" \
@ -326,11 +327,12 @@ declare -p "${prefix}__skip_update" "${prefix}__env" "${prefix}__help" \
"${prefix}_command_" "${prefix}_host_" "${prefix}_user_" "${prefix}_port_" \ "${prefix}_command_" "${prefix}_host_" "${prefix}_user_" "${prefix}_port_" \
"${prefix}_provider_" "${prefix}_subcommands_" "${prefix}app" "${prefix}list" \ "${prefix}_provider_" "${prefix}_subcommands_" "${prefix}app" "${prefix}list" \
"${prefix}ls" "${prefix}new" "${prefix}backup" "${prefix}deploy" \ "${prefix}ls" "${prefix}new" "${prefix}backup" "${prefix}deploy" \
"${prefix}check" "${prefix}config" "${prefix}cp" "${prefix}logs" "${prefix}ps" \ "${prefix}check" "${prefix}version" "${prefix}config" "${prefix}cp" \
"${prefix}restore" "${prefix}rm" "${prefix}delete" "${prefix}run" \ "${prefix}logs" "${prefix}ps" "${prefix}restore" "${prefix}rm" \
"${prefix}rollback" "${prefix}secret" "${prefix}generate" "${prefix}insert" \ "${prefix}delete" "${prefix}run" "${prefix}rollback" "${prefix}secret" \
"${prefix}undeploy" "${prefix}server" "${prefix}add" "${prefix}init" \ "${prefix}generate" "${prefix}insert" "${prefix}undeploy" "${prefix}server" \
"${prefix}apps" "${prefix}upgrade" "${prefix}version" "${prefix}help"; done; } "${prefix}add" "${prefix}init" "${prefix}apps" "${prefix}upgrade" \
"${prefix}help"; done; }
# docopt parser above, complete command for generating this parser is `docopt.sh abra` # docopt parser above, complete command for generating this parser is `docopt.sh abra`
PROGRAM_NAME=$(basename "$0") PROGRAM_NAME=$(basename "$0")
@ -1139,6 +1141,12 @@ sub_app_config (){
$EDITOR "$ENV_FILE" $EDITOR "$ENV_FILE"
} }
###### .. app version
sub_app_version (){
# shellcheck disable=SC2016
echo '`abra app <app> version` command working correctly!'
}
###### .. app check ###### .. app check
help_app_check (){ help_app_check (){
echo "abra [options] app <app> check echo "abra [options] app <app> check
@ -1866,8 +1874,11 @@ abra() {
load_abra_sh load_abra_sh
# Search for sub_* functions, and check if any of them matches enabled # Search for sub_* functions, and check if any of them matches enabled
# arguments (i.e. is a command and is specified) # arguments (i.e. is a command and is specified). The `awk / sort` sorts by
for SUBCOMMAND in $(declare -Ff | grep 'sub_' | cut -d' ' -f3 | sort -r); do # the number of occurrences of '_' in the function name, to ensure that
# `abra app <app> version` will be matched before `abra version`.
SUBCOMMANDS=$(declare -Ff | grep 'sub_' | cut -d' ' -f3 | awk '{ print gsub("_","&"), $0 }' | sort -n -r | cut -d" " -f2-)
for SUBCOMMAND in $SUBCOMMANDS; do
IFS='_' read -r -a PARTS <<< "$SUBCOMMAND" IFS='_' read -r -a PARTS <<< "$SUBCOMMAND"
for PART in "${PARTS[@]:1}"; do for PART in "${PARTS[@]:1}"; do
# TODO 3wc: probably a better way to check if a variable is defined.. # TODO 3wc: probably a better way to check if a variable is defined..