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 10, 2024
1 parent a730fc4 commit a9ad6ab
Show file tree
Hide file tree
Showing 2 changed files with 18 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
5 changes: 5 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 @@ -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()


Expand Down

0 comments on commit a9ad6ab

Please sign in to comment.