From c09703053b93efc12d50ebbe15f42e30e1f09768 Mon Sep 17 00:00:00 2001 From: fluzzi Date: Mon, 4 Apr 2022 14:41:51 -0300 Subject: [PATCH] add 1 character arguments --- README.md | 24 ++++++++-------- connpy/__init__.py | 23 +++++++-------- connpy/connapp.py | 18 ++++++------ docs/connpy/index.html | 64 ++++++++++++++++++++++-------------------- 4 files changed, 67 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index aa85be4..4f11543 100644 --- a/README.md +++ b/README.md @@ -70,12 +70,13 @@ positional arguments: #### Options: ``` - -h, --help show this help message and exit - --add Add new node[@subfolder][@folder] or [@subfolder]@folder - --del, --rm Delete node[@subfolder][@folder] or [@subfolder]@folder - --mod, --edit Modify node[@subfolder][@folder] - --show Show node[@subfolder][@folder] - --debug, -d Display all conections steps + -h, --help show this help message and exit + -a, --add Add new node[@subfolder][@folder] or [@subfolder]@folder + -r, --del, --rm Delete node[@subfolder][@folder] or [@subfolder]@folder + -e, --mod, --edit Modify node[@subfolder][@folder] + -s, --show Show node[@subfolder][@folder] + -d, --debug Display all conections steps + ``` #### Commands: @@ -96,11 +97,12 @@ positional arguments: profile Name of profile to manage options: - -h, --help show this help message and exit - --add Add new profile - --del, --rm Delete profile - --mod, --edit Modify profile - --show Show profile + -h, --help show this help message and exit + -a, --add Add new profile + -r, --del, --rm Delete profile + -e, --mod, --edit Modify profile + -s, --show Show profile + ``` #### Examples: diff --git a/connpy/__init__.py b/connpy/__init__.py index ecaf9e9..b65d75b 100644 --- a/connpy/__init__.py +++ b/connpy/__init__.py @@ -23,12 +23,12 @@ positional arguments: [@subfolder][@folder] Show all available connections globaly or in specified path Options: - -h, --help show this help message and exit - --add Add new node[@subfolder][@folder] or [@subfolder]@folder - --del, --rm Delete node[@subfolder][@folder] or [@subfolder]@folder - --mod, --edit Modify node[@subfolder][@folder] - --show Show node[@subfolder][@folder] - --debug, -d Display all conections steps + -h, --help show this help message and exit + -a, --add Add new node[@subfolder][@folder] or [@subfolder]@folder + -r, --del, --rm Delete node[@subfolder][@folder] or [@subfolder]@folder + -e, --mod, --edit Modify node[@subfolder][@folder] + -s, --show Show node[@subfolder][@folder] + -d, --debug Display all conections steps Commands: profile Manage profiles @@ -47,11 +47,12 @@ positional arguments: profile Name of profile to manage options: - -h, --help show this help message and exit - --add Add new profile - --del, --rm Delete profile - --mod, --edit Modify profile - --show Show profile + -h, --help show this help message and exit + -a, --add Add new profile + -r, --del, --rm Delete profile + -e, --mod, --edit Modify profile + -s, --show Show profile + ``` ### Examples diff --git a/connpy/connapp.py b/connpy/connapp.py index c54c39b..b503cd3 100755 --- a/connpy/connapp.py +++ b/connpy/connapp.py @@ -40,20 +40,20 @@ class connapp: nodeparser = subparsers.add_parser("node",usage=self._help("usage"), help=self._help("node"),epilog=self._help("end"), formatter_class=argparse.RawTextHelpFormatter) nodecrud = nodeparser.add_mutually_exclusive_group() nodeparser.add_argument("node", metavar="node|folder", nargs='?', default=None, action=self._store_type, type=self._type_node, help=self._help("node")) - nodecrud.add_argument("--add", dest="action", action="store_const", help="Add new node[@subfolder][@folder] or [@subfolder]@folder", const="add", default="connect") - nodecrud.add_argument("--del", "--rm", dest="action", action="store_const", help="Delete node[@subfolder][@folder] or [@subfolder]@folder", const="del", default="connect") - nodecrud.add_argument("--mod", "--edit", dest="action", action="store_const", help="Modify node[@subfolder][@folder]", const="mod", default="connect") - nodecrud.add_argument("--show", dest="action", action="store_const", help="Show node[@subfolder][@folder]", const="show", default="connect") - nodecrud.add_argument("--debug", "-d", dest="action", action="store_const", help="Display all conections steps", const="debug", default="connect") + nodecrud.add_argument("-a","--add", dest="action", action="store_const", help="Add new node[@subfolder][@folder] or [@subfolder]@folder", const="add", default="connect") + nodecrud.add_argument("-r","--del", "--rm", dest="action", action="store_const", help="Delete node[@subfolder][@folder] or [@subfolder]@folder", const="del", default="connect") + nodecrud.add_argument("-e","--mod", "--edit", dest="action", action="store_const", help="Modify node[@subfolder][@folder]", const="mod", default="connect") + nodecrud.add_argument("-s","--show", dest="action", action="store_const", help="Show node[@subfolder][@folder]", const="show", default="connect") + nodecrud.add_argument("-d","--debug", dest="action", action="store_const", help="Display all conections steps", const="debug", default="connect") nodeparser.set_defaults(func=self._func_node) #PROFILEPARSER profileparser = subparsers.add_parser("profile", help="Manage profiles") profileparser.add_argument("profile", nargs=1, action=self._store_type, type=self._type_profile, help="Name of profile to manage") profilecrud = profileparser.add_mutually_exclusive_group(required=True) - profilecrud.add_argument("--add", dest="action", action="store_const", help="Add new profile", const="add") - profilecrud.add_argument("--del", "--rm", dest="action", action="store_const", help="Delete profile", const="del") - profilecrud.add_argument("--mod", "--edit", dest="action", action="store_const", help="Modify profile", const="mod") - profilecrud.add_argument("--show", dest="action", action="store_const", help="Show profile", const="show") + profilecrud.add_argument("-a", "--add", dest="action", action="store_const", help="Add new profile", const="add") + profilecrud.add_argument("-r", "--del", "--rm", dest="action", action="store_const", help="Delete profile", const="del") + profilecrud.add_argument("-e", "--mod", "--edit", dest="action", action="store_const", help="Modify profile", const="mod") + profilecrud.add_argument("-s", "--show", dest="action", action="store_const", help="Show profile", const="show") profileparser.set_defaults(func=self._func_profile) #MOVEPARSER moveparser = subparsers.add_parser("move", aliases=["mv"], help="Move node") diff --git a/docs/connpy/index.html b/docs/connpy/index.html index 4d7b124..4b56e1e 100644 --- a/docs/connpy/index.html +++ b/docs/connpy/index.html @@ -42,12 +42,12 @@ positional arguments: [@subfolder][@folder] Show all available connections globaly or in specified path Options: - -h, --help show this help message and exit - --add Add new node[@subfolder][@folder] or [@subfolder]@folder - --del, --rm Delete node[@subfolder][@folder] or [@subfolder]@folder - --mod, --edit Modify node[@subfolder][@folder] - --show Show node[@subfolder][@folder] - --debug, -d Display all conections steps + -h, --help show this help message and exit + -a, --add Add new node[@subfolder][@folder] or [@subfolder]@folder + -r, --del, --rm Delete node[@subfolder][@folder] or [@subfolder]@folder + -e, --mod, --edit Modify node[@subfolder][@folder] + -s, --show Show node[@subfolder][@folder] + -d, --debug Display all conections steps Commands: profile Manage profiles @@ -64,11 +64,12 @@ positional arguments: profile Name of profile to manage options: - -h, --help show this help message and exit - --add Add new profile - --del, --rm Delete profile - --mod, --edit Modify profile - --show Show profile + -h, --help show this help message and exit + -a, --add Add new profile + -r, --del, --rm Delete profile + -e, --mod, --edit Modify profile + -s, --show Show profile +

Examples

   conn profile --add office-user
@@ -155,12 +156,12 @@ positional arguments:
                  [@subfolder][@folder]
                  Show all available connections globaly or in specified path
 Options:
-  -h, --help     show this help message and exit
-  --add          Add new node[@subfolder][@folder] or [@subfolder]@folder
-  --del, --rm    Delete node[@subfolder][@folder] or [@subfolder]@folder
-  --mod, --edit  Modify node[@subfolder][@folder]
-  --show         Show node[@subfolder][@folder]
-  --debug, -d    Display all conections steps
+  -h, --help         show this help message and exit
+  -a, --add          Add new node[@subfolder][@folder] or [@subfolder]@folder
+  -r, --del, --rm    Delete node[@subfolder][@folder] or [@subfolder]@folder
+  -e, --mod, --edit  Modify node[@subfolder][@folder]
+  -s, --show         Show node[@subfolder][@folder]
+  -d, --debug        Display all conections steps
 
 Commands:
   profile        Manage profiles
@@ -179,11 +180,12 @@ positional arguments:
   profile        Name of profile to manage
 
 options:
-  -h, --help     show this help message and exit
-  --add          Add new profile
-  --del, --rm    Delete profile
-  --mod, --edit  Modify profile
-  --show         Show profile
+  -h, --help         show this help message and exit
+  -a, --add          Add new profile
+  -r, --del, --rm    Delete profile
+  -e, --mod, --edit  Modify profile
+  -s, --show         Show profile
+
 ```
 
 ###   Examples
@@ -637,20 +639,20 @@ __pdoc__ = {
         nodeparser = subparsers.add_parser("node",usage=self._help("usage"), help=self._help("node"),epilog=self._help("end"), formatter_class=argparse.RawTextHelpFormatter) 
         nodecrud = nodeparser.add_mutually_exclusive_group()
         nodeparser.add_argument("node", metavar="node|folder", nargs='?', default=None, action=self._store_type, type=self._type_node, help=self._help("node"))
-        nodecrud.add_argument("--add", dest="action", action="store_const", help="Add new node[@subfolder][@folder] or [@subfolder]@folder", const="add", default="connect")
-        nodecrud.add_argument("--del", "--rm", dest="action", action="store_const", help="Delete node[@subfolder][@folder] or [@subfolder]@folder", const="del", default="connect")
-        nodecrud.add_argument("--mod", "--edit", dest="action", action="store_const", help="Modify node[@subfolder][@folder]", const="mod", default="connect")
-        nodecrud.add_argument("--show", dest="action", action="store_const", help="Show node[@subfolder][@folder]", const="show", default="connect")
-        nodecrud.add_argument("--debug", "-d", dest="action", action="store_const", help="Display all conections steps", const="debug", default="connect")
+        nodecrud.add_argument("-a","--add", dest="action", action="store_const", help="Add new node[@subfolder][@folder] or [@subfolder]@folder", const="add", default="connect")
+        nodecrud.add_argument("-r","--del", "--rm", dest="action", action="store_const", help="Delete node[@subfolder][@folder] or [@subfolder]@folder", const="del", default="connect")
+        nodecrud.add_argument("-e","--mod", "--edit", dest="action", action="store_const", help="Modify node[@subfolder][@folder]", const="mod", default="connect")
+        nodecrud.add_argument("-s","--show", dest="action", action="store_const", help="Show node[@subfolder][@folder]", const="show", default="connect")
+        nodecrud.add_argument("-d","--debug", dest="action", action="store_const", help="Display all conections steps", const="debug", default="connect")
         nodeparser.set_defaults(func=self._func_node)
         #PROFILEPARSER
         profileparser = subparsers.add_parser("profile", help="Manage profiles") 
         profileparser.add_argument("profile", nargs=1, action=self._store_type, type=self._type_profile, help="Name of profile to manage")
         profilecrud = profileparser.add_mutually_exclusive_group(required=True)
-        profilecrud.add_argument("--add", dest="action", action="store_const", help="Add new profile", const="add")
-        profilecrud.add_argument("--del", "--rm", dest="action", action="store_const", help="Delete profile", const="del")
-        profilecrud.add_argument("--mod", "--edit", dest="action", action="store_const", help="Modify profile", const="mod")
-        profilecrud.add_argument("--show", dest="action", action="store_const", help="Show profile", const="show")
+        profilecrud.add_argument("-a", "--add", dest="action", action="store_const", help="Add new profile", const="add")
+        profilecrud.add_argument("-r", "--del", "--rm", dest="action", action="store_const", help="Delete profile", const="del")
+        profilecrud.add_argument("-e", "--mod", "--edit", dest="action", action="store_const", help="Modify profile", const="mod")
+        profilecrud.add_argument("-s", "--show", dest="action", action="store_const", help="Show profile", const="show")
         profileparser.set_defaults(func=self._func_profile)
         #MOVEPARSER
         moveparser = subparsers.add_parser("move", aliases=["mv"], help="Move node")