From d1df2a4cf66ea9ab5d92a9b064c2b020314479a1 Mon Sep 17 00:00:00 2001 From: fluzzi Date: Mon, 4 Apr 2022 14:54:37 -0300 Subject: [PATCH] fixes extra arguments --- connpy/connapp.py | 12 ++++++------ docs/connpy/index.html | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/connpy/connapp.py b/connpy/connapp.py index b503cd3..15fd1b8 100755 --- a/connpy/connapp.py +++ b/connpy/connapp.py @@ -79,7 +79,7 @@ class connapp: configparser.set_defaults(func=self._func_others) #Set default subparser and tune arguments commands = ["node", "profile", "mv", "move","copy", "cp", "bulk", "ls", "list", "config"] - profilecmds = ["--add", "--del", "--rm", "--mod", "--edit", "--show"] + profilecmds = ["--add", "-a", "--del", "--rm", "-r", "--mod", "--edit", "-e", "--show", "-s"] if len(sys.argv) >= 3 and sys.argv[2] == "profile" and sys.argv[1] in profilecmds: sys.argv[2] = sys.argv[1] sys.argv[1] = "profile" @@ -699,11 +699,11 @@ _conn() strings="" if [ "${COMP_WORDS[1]}" = "profile" ]; then strings="--add --rm --del --edit --mod --show --help"; fi if [ "${COMP_WORDS[1]}" = "config" ]; then strings="--allow-uppercase --keepalive --completion --help"; fi - if [[ "${COMP_WORDS[1]}" =~ ^--mod|--edit|--show|--add|--rm|--del$ ]]; then strings="profile"; fi + if [[ "${COMP_WORDS[1]}" =~ ^--mod|--edit|-e|--show|-s|--add|-a|--rm|--del|-r$ ]]; then strings="profile"; fi if [[ "${COMP_WORDS[1]}" =~ ^list|ls$ ]]; then strings="profiles nodes folders"; fi if [[ "${COMP_WORDS[1]}" =~ ^bulk|mv|move|cp|copy$$ ]]; then strings="--help"; fi - if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del$ ]]; then strings="$strings ${folders[@]/#/@}"; fi - if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|--mod|--edit|mv|move|cp|copy|--show$ ]]; then + if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|-r$ ]]; then strings="$strings ${folders[@]/#/@}"; fi + if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|-r|--mod|--edit|-e|mv|move|cp|copy|--show|-s$ ]]; then strings="$strings ${connections[@]}" fi COMPREPLY=($(compgen -W "$strings" -- "${COMP_WORDS[2]}")) @@ -711,12 +711,12 @@ _conn() if [ "${#COMP_WORDS[@]}" = "4" ]; then strings="" if [ "${COMP_WORDS[1]}" = "profile" ]; then - if [[ "${COMP_WORDS[2]}" =~ ^--rm|--del|--mod|--edit|--show$ ]] ; then + if [[ "${COMP_WORDS[2]}" =~ ^--rm|--del|-r|--mod|--edit|-e|--show|-s$ ]] ; then strings="$strings ${profiles[@]}" fi fi if [ "${COMP_WORDS[2]}" = "profile" ]; then - if [[ "${COMP_WORDS[1]}" =~ ^--rm|--remove|--del|--mod|--edit|--show$ ]] ; then + if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|-r|--mod|--edit|-e|--show|-s$ ]] ; then strings="$strings ${profiles[@]}" fi fi diff --git a/docs/connpy/index.html b/docs/connpy/index.html index 4b56e1e..da1162b 100644 --- a/docs/connpy/index.html +++ b/docs/connpy/index.html @@ -678,7 +678,7 @@ __pdoc__ = { configparser.set_defaults(func=self._func_others) #Set default subparser and tune arguments commands = ["node", "profile", "mv", "move","copy", "cp", "bulk", "ls", "list", "config"] - profilecmds = ["--add", "--del", "--rm", "--mod", "--edit", "--show"] + profilecmds = ["--add", "-a", "--del", "--rm", "-r", "--mod", "--edit", "-e", "--show", "-s"] if len(sys.argv) >= 3 and sys.argv[2] == "profile" and sys.argv[1] in profilecmds: sys.argv[2] = sys.argv[1] sys.argv[1] = "profile" @@ -1298,11 +1298,11 @@ _conn() strings="" if [ "${COMP_WORDS[1]}" = "profile" ]; then strings="--add --rm --del --edit --mod --show --help"; fi if [ "${COMP_WORDS[1]}" = "config" ]; then strings="--allow-uppercase --keepalive --completion --help"; fi - if [[ "${COMP_WORDS[1]}" =~ ^--mod|--edit|--show|--add|--rm|--del$ ]]; then strings="profile"; fi + if [[ "${COMP_WORDS[1]}" =~ ^--mod|--edit|-e|--show|-s|--add|-a|--rm|--del|-r$ ]]; then strings="profile"; fi if [[ "${COMP_WORDS[1]}" =~ ^list|ls$ ]]; then strings="profiles nodes folders"; fi if [[ "${COMP_WORDS[1]}" =~ ^bulk|mv|move|cp|copy$$ ]]; then strings="--help"; fi - if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del$ ]]; then strings="$strings ${folders[@]/#/@}"; fi - if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|--mod|--edit|mv|move|cp|copy|--show$ ]]; then + if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|-r$ ]]; then strings="$strings ${folders[@]/#/@}"; fi + if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|-r|--mod|--edit|-e|mv|move|cp|copy|--show|-s$ ]]; then strings="$strings ${connections[@]}" fi COMPREPLY=($(compgen -W "$strings" -- "${COMP_WORDS[2]}")) @@ -1310,12 +1310,12 @@ _conn() if [ "${#COMP_WORDS[@]}" = "4" ]; then strings="" if [ "${COMP_WORDS[1]}" = "profile" ]; then - if [[ "${COMP_WORDS[2]}" =~ ^--rm|--del|--mod|--edit|--show$ ]] ; then + if [[ "${COMP_WORDS[2]}" =~ ^--rm|--del|-r|--mod|--edit|-e|--show|-s$ ]] ; then strings="$strings ${profiles[@]}" fi fi if [ "${COMP_WORDS[2]}" = "profile" ]; then - if [[ "${COMP_WORDS[1]}" =~ ^--rm|--remove|--del|--mod|--edit|--show$ ]] ; then + if [[ "${COMP_WORDS[1]}" =~ ^--rm|--del|-r|--mod|--edit|-e|--show|-s$ ]] ; then strings="$strings ${profiles[@]}" fi fi