Skip to content

Commit

Permalink
feat: Add completion generation
Browse files Browse the repository at this point in the history
  • Loading branch information
lperdereau committed Dec 9, 2024
1 parent a730fc4 commit c7c79bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
24 changes: 13 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions src/pvecontrol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -102,10 +104,14 @@ def _parser():
parser_sanitycheck = subparsers.add_parser('sanitycheck', help='Run Sanity checks on the cluster')
parser_sanitycheck.set_defaults(func=actions.cluster.action_sanitycheck)


# _test parser, hidden from help
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()


Expand Down

0 comments on commit c7c79bf

Please sign in to comment.