Skip to content
Snippets Groups Projects
Commit 84eca126 authored by James Graham's avatar James Graham
Browse files

feat: add secret flags for output formatting

parent 28ad67f3
No related branches found
No related tags found
No related merge requests found
......@@ -228,6 +228,14 @@ def parse_arguments(arg_list):
run_options.add_argument('--log-level', default='INFO',
choices=('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'),
help="Which log messages should be shown?")
# Secret options
secret_options = parser.add_argument_group("secret options")
secret_options.add_argument('--curmudgeon', default=False, action='store_true',
help=argparse.SUPPRESS)
secret_options.add_argument('--cow', default=False, action='store_true',
help=argparse.SUPPRESS)
# yapf: enable
args = parser.parse_args(arg_list)
......@@ -267,6 +275,10 @@ def main():
start_time = time.time()
args = parse_arguments(sys.argv[1:])
if args.curmudgeon:
logging.basicConfig(level=args.log_level)
else:
logging.basicConfig(level=args.log_level,
format='%(message)s',
datefmt='[%X]',
......@@ -283,6 +295,16 @@ def main():
|___/
""" # noqa
banner = textwrap.dedent(banner)
if args.cow:
try:
import cowsay
banner = cowsay.cow('PyCGTOOL')
except ImportError:
pass
else:
logger.info('[bold blue]%s[/]',
textwrap.dedent(banner),
extra={'markup': True})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment