Define envars for common kgtk comand options.
@@ -279,12 +279,30 @@ def cli_entry(*args):
help='check dependencies',
)
shared_args = base_parser.add_argument_group('shared optional arguments')
- shared_args.add_argument('--debug', dest='_debug', action='store_true', default=False, help='enable debug mode')
- shared_args.add_argument('--expert', dest='_expert', action='store_true', default=False, help='enable expert mode')
- shared_args.add_argument('--pipedebug', dest='_pipedebug', action='store_true', default=False, help='enable pipe debug mode')
- shared_args.add_argument('--progress', dest='_progress', action='store_true', default=False, help='enable progress monitoring')
- shared_args.add_argument('--progress-tty', dest='_progress_tty', action='store', default="/dev/tty", help='progress monitoring output tty')
- shared_args.add_argument('--timing', dest='_timing', action='store_true', default=False, help='enable timing measurements')
+ shared_args.add_argument('--debug', dest='_debug', action='store_true',
+ default=os.getenv('KGTK_OPTION_DEBUG', 'False').lower() in ['y', 'yes', 'true'],
+ help='enable debug mode')
+
+ shared_args.add_argument('--expert', dest='_expert', action='store_true',
+ default=os.getenv('KGTK_OPTION_EXPERT', 'False').lower() in ['y', 'yes', 'true'],
+ help='enable expert mode')
+
+ shared_args.add_argument('--pipedebug', dest='_pipedebug', action='store_true',
+ default=os.getenv('KGTK_OPTION_PIPEDEBUG', 'False').lower() in ['y', 'yes', 'true'],
+ help='enable pipe debug mode')
+
+ shared_args.add_argument('--progress', dest='_progress', action='store_true',
+ default=os.getenv('KGTK_OPTION_PROGRESS', 'False').lower() in ['y', 'yes', 'true'],
+ help='enable progress monitoring')
+
+ shared_args.add_argument('--progress-tty', dest='_progress_tty', action='store',
+ default=os.getenv('KGTK_OPTION_PROGRESS_TTY', "/dev/tty"),
+ help='progress monitoring output tty')
+
+ shared_args.add_argument('--timing', dest='_timing', action='store_true',
+ default=os.getenv('KGTK_OPTION_TIMING', 'False').lower() in ['y', 'yes', 'true'],
+ help='enable timing measurements')
+
add_shared_arguments(shared_args)
# parse shared arguments
