cli — CLI#
This module is intended to provide common utilities for command-line interface, ensuring consistency across different applications and allowing for the automation of common operations, such as the logging configuration.
Module documentation#
Command-line arguments.
- class astropix_analysis.cli._Formatter(prog, indent_increment=2, max_help_position=24, width=None)[source]#
Do nothing class combining our favorite formatting for the command-line options, i.e., the newlines in the descriptions are preserved and, at the same time, the argument defaults are printed out when the –help options is passed.
The inspiration for this is coming from one of the comments in https://stackoverflow.com/questions/3853722
- class astropix_analysis.cli.ArgumentParser(description: str, epilog: str = None)[source]#
Application-wide argument parser.
- static _expand_wildcards(file_list: list) list[source]#
Expand the wildcards in a given list of file paths.
This is intended to emulate the bash shell expansion under Windows when the
infilescommand-line argument is passed.
- parse_args(args: list = None, namespace: Namespace = None) Namespace[source]#
Overloaded method.
This is calling the method from the base class and, before returning the arguments, resets the logger with the proper level—so that this operation happens transparently for the user with no boilerplate code.