diff options
| author | Scott Gasch <[email protected]> | 2022-02-12 11:20:27 -0800 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-02-12 11:20:27 -0800 |
| commit | 2bf59f4f017a7497aaf0449bdf77e130abdf36d8 (patch) | |
| tree | a0f9153d9edc2be0b22347212e35552e3a331fc4 /config.py | |
| parent | beac1437b595ed543595b12b81ab637d4737038a (diff) | |
Try another tactic to figure out entry point.
Diffstat (limited to 'config.py')
| -rw-r--r-- | config.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -172,7 +172,7 @@ def is_flag_already_in_argv(var: str): return False -def reorder_arg_action_groups(entry_module: Optional[str]): +def reorder_arg_action_groups_before_help(entry_module: Optional[str]): reordered_action_groups = [] for grp in ARGS._action_groups: if entry_module is not None and entry_module in grp.title: # type: ignore @@ -269,7 +269,9 @@ def parse(entry_module: Optional[str]) -> Dict[str, Any]: # screen w/o scrolling. for arg in sys.argv: if arg in ('--help', '-h'): - ARGS._action_groups = reorder_arg_action_groups(entry_module) + if entry_module is not None: + entry_module = os.path.basename(entry_module) + ARGS._action_groups = reorder_arg_action_groups_before_help(entry_module) # Examine the environment for variables that match known flags. # For a flag called --example_flag the corresponding environment |
