Skip to content

Commit

Permalink
Add argcomplete for autocompletition
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Jan 10, 2025
1 parent cfd33f7 commit b5e0257
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
argcomplete
pyyaml
pexpect
requests
Expand Down
5 changes: 5 additions & 0 deletions src/nanosaur/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# PYTHON_ARGCOMPLETE_OK
# Copyright (C) 2024, Raffaello Bonghi <raffaello@rnext.it>
# All rights reserved
# Redistribution and use in source and binary forms, with or without
Expand All @@ -24,6 +25,7 @@
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import argparse
import argcomplete
import sys
import subprocess
from jtop import jtop, JtopException
Expand Down Expand Up @@ -150,6 +152,9 @@ def main():
'control', help="Drive nanosaur")
parser_control.set_defaults(func=control.control_keyboard)

# Enable autocomplete
argcomplete.autocomplete(parser)

# Parse the arguments
args = parser.parse_args()

Expand Down

0 comments on commit b5e0257

Please sign in to comment.