refactor: standardize command naming

This standardization makes it somewhat easier to read stacktraces as the command names are all uniform, so it will be slightly easier to scan trace output.
This commit is contained in:
Jose Diaz-Gonzalez
2020-02-09 22:41:39 -05:00
parent deea791e58
commit 1cb586b2e7
134 changed files with 246 additions and 245 deletions

View File

@@ -6,7 +6,7 @@ set -eo pipefail
case "$1" in
help | ssh-keys:help)
ssh_keys_help_cmd "$@"
cmd-ssh-keys-help "$@"
;;
*)

View File

@@ -3,13 +3,6 @@ set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
list_ssh_keys() {
declare desc="List ssh key hashes"
local cmd="ssh-keys:list"
verify_ssh_key_file
sshcommand list dokku
}
verify_ssh_key_file() {
declare desc="Test that public key is valid"
[[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found."

View File

@@ -11,7 +11,7 @@ ssh_keys_help_content_func() {
help_content
}
ssh_keys_help_cmd() {
cmd-ssh-keys-help() {
if [[ $1 == "ssh-keys:help" ]]; then
echo -e 'Usage: dokku ssh-keys[:COMMAND]'
echo ''
@@ -27,3 +27,11 @@ ssh_keys_help_cmd() {
help_desc
fi
}
cmd-list-ssh-keys() {
declare desc="List ssh key hashes"
local cmd="ssh-keys:list"
verify_ssh_key_file
sshcommand list dokku
}

View File

@@ -4,7 +4,7 @@ set -eo pipefail
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
add_keys() {
cmd-ssh-keys-add() {
declare desc="add a new key via sshcommand"
local cmd="ssh-keys:add"
[[ "$1" == "$cmd" ]] && shift 1
@@ -38,4 +38,4 @@ add_keys() {
verify_ssh_key_file
}
add_keys "$@"
cmd-ssh-keys-add "$@"

View File

@@ -3,4 +3,4 @@ set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/internal-functions"
ssh_keys_help_cmd "ssh-keys:help"
cmd-ssh-keys-help "ssh-keys:help"

View File

@@ -2,6 +2,6 @@
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/internal-functions"
list_ssh_keys "$@"
cmd-ssh-keys-list "$@"

View File

@@ -4,7 +4,7 @@ set -eo pipefail
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
remove_key() {
cmd-ssh-keys-remove() {
declare desc="Removes key from authorized_keys"
local cmd="ssh-keys:remove"
shift
@@ -14,4 +14,4 @@ remove_key() {
sshcommand acl-remove dokku "$name" || dokku_log_fail "sshcommand returned an error $?"
}
remove_key "$@"
cmd-ssh-keys-remove "$@"