diff --git a/requirements.txt b/requirements.txt index 986a483..38313e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,13 @@ - prettytable - humanize - confuse - pyyaml - urllib3 -# proxmoxer depdends - proxmoxer>=2.0.1 - requests - requests_toolbelt - openssh_wrapper - paramiko +prettytable +humanize +confuse +pyyaml +urllib3 +shtab + +# proxmoxer depdends +proxmoxer>=2.0.1 +requests +requests_toolbelt +openssh_wrapper +paramiko diff --git a/src/pvecontrol/__init__.py b/src/pvecontrol/__init__.py index 60243f2..11681c9 100644 --- a/src/pvecontrol/__init__.py +++ b/src/pvecontrol/__init__.py @@ -7,10 +7,12 @@ import logging import re import pvecontrol.actions +import shtab from pvecontrol.cluster import PVECluster from pvecontrol.config import set_config + def action_test(proxmox, args): """Hidden optional test action""" print(proxmox) @@ -106,6 +108,9 @@ def _parser(): parser_test = subparsers.add_parser('_test') parser_test.set_defaults(func=action_test) + # shell autocomplete generation + shtab.add_argument_to(parser, ["-s", "--print-completion"]) + return parser.parse_args()