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:
@@ -6,7 +6,7 @@ set -eo pipefail
|
||||
|
||||
case "$1" in
|
||||
help | ssh-keys:help)
|
||||
ssh_keys_help_cmd "$@"
|
||||
cmd-ssh-keys-help "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user