mirror of
https://github.com/python-escpos/python-escpos
synced 2025-09-13 09:09:58 +00:00
autodocument argparser
This commit is contained in:
@@ -487,12 +487,8 @@ def print_extended_information() -> None:
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
"""Handle main entry point of CLI script.
|
||||
|
||||
Handles loading of configuration and creating and processing of command
|
||||
line arguments. Called when run from a CLI.
|
||||
"""
|
||||
def generate_parser() -> argparse.ArgumentParser:
|
||||
"""Generate an argparse parser."""
|
||||
parser = argparse.ArgumentParser(
|
||||
description="CLI for python-escpos",
|
||||
epilog="Printer configuration is defined in the python-escpos config"
|
||||
@@ -563,6 +559,17 @@ def main():
|
||||
)
|
||||
parser_command_version_extended.set_defaults(version_extended=True)
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
def main():
|
||||
"""Handle main entry point of CLI script.
|
||||
|
||||
Handles loading of configuration and creating and processing of command
|
||||
line arguments. Called when run from a CLI.
|
||||
"""
|
||||
parser = generate_parser()
|
||||
|
||||
# hook in argcomplete
|
||||
if "argcomplete" in globals():
|
||||
argcomplete.autocomplete(parser)
|
||||
|
Reference in New Issue
Block a user