diff --git a/src/xts_core/xts.py b/src/xts_core/xts.py index 4940bfc..846ec34 100755 --- a/src/xts_core/xts.py +++ b/src/xts_core/xts.py @@ -77,6 +77,7 @@ class XTS(): _xts_config (dict, optional): Parsed XTS configuration data. Defaults to None. _command_sections (dict): Dictionary of command sections extracted from configuration. _plugins (list): List of plugin classes providing additional commands. + _alias_name (str, optional): The alias name used to invoke the command. Defaults to None. """ def __init__(self): @@ -86,6 +87,7 @@ def __init__(self): self._xts_config = None self._command_sections = {} self._plugins = [XTSAllocatorClient] + self._alias_name = None @property def xts_config(self): @@ -202,6 +204,7 @@ def _parse_first_arg(self): # load xts config remove alias name from argv before parsing self.xts_config = resolved_xts_path + self._alias_name = alias_name return remaining_args[1:] @@ -214,9 +217,10 @@ def run(self): args = self._parse_first_arg() try: + prog_name = f'xts {self._alias_name}' if self._alias_name else 'xts' yaml_runner = YamlRunner( self._command_sections, - program='xts', + program=prog_name, hierarchical=True, fail_fast=True, parser_class=XTSArgumentParser