Skip to content

Conversation

Copy link

Copilot AI commented Jan 28, 2026

When invoking xts <alias> --help, the help message showed Usage: xts [-h] instead of Usage: xts <alias> [-h], making usage examples incorrect for aliased commands.

Changes

  • Added _alias_name instance variable to XTS class to capture the resolved alias name
  • Store alias name in _parse_first_arg() after resolution
  • Construct prog name as f'xts {self._alias_name}' when initializing YamlRunner in run() method

Example

Before:

$ xts hello_world --help
Usage: xts [-h] {run} ...

After:

$ xts hello_world --help
Usage: xts hello_world [-h] {run} ...
Original prompt

This section details on the original issue you should resolve

<issue_title>Bug: prog name passed into YamlRunner does not include the alias name</issue_title>
<issue_description>### Problem/Opportunity

When running xts <alias name> --help it prints the help message from yaml runner. This displays showing the "prog" name given to YamlRunner followed by available options.

Currently, only xts is passed to YamlRunner meaning when the help message prints it only displays as xts <options> as if the options could be run without using the alias name.

Steps to reproduce

No response

Expected Behavior

The prog name should display as the combination xts and the alias name used, so the usage message displayed is the actual command a user could run.

Usage: xts hello_world [-h] {run} ...

Positional Arguments:
  {run}
    run       Run a command.

Options:
  -h, --help  show this help message and exit

Actual Behavior

The command run here was xts hello_world --help

Usage: xts [-h] {run} ...

Positional Arguments:
  {run}
    run       Run a command.

Options:
  -h, --help  show this help message and exit

But the usage does not show hello_world, instead it displays as if run can be used without the alias name.

Notes (Optional)

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix prog name in YamlRunner help message Include alias name in YamlRunner prog parameter for help messages Jan 28, 2026
Copilot AI requested a review from TB-1993 January 28, 2026 16:17
Copilot AI changed the title Include alias name in YamlRunner prog parameter for help messages Remove unnecessary instance variable for alias name Jan 28, 2026
Copilot AI changed the title Remove unnecessary instance variable for alias name Include alias name in YamlRunner prog parameter Jan 30, 2026
@TB-1993 TB-1993 marked this pull request as ready for review February 6, 2026 11:35
@TB-1993 TB-1993 requested a review from a team as a code owner February 6, 2026 11:35
Copilot AI review requested due to automatic review settings February 6, 2026 11:35
@github-actions
Copy link

github-actions bot commented Feb 6, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the CLI “prog” value passed to YamlRunner so xts <alias> --help shows correct usage including the alias name, aligning help output with how users actually invoke aliased commands.

Changes:

  • Added _alias_name to XTS to track the alias used for invocation.
  • Set _alias_name during first-arg parsing after alias resolution.
  • Passed program=f'xts {alias}' into YamlRunner so usage includes the alias.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +203 to +207
raise SystemExit(1)

# load xts config remove alias name from argv before parsing
self.xts_config = resolved_xts_path
self._alias_name = alias_name
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utils.error(...) already raises SystemExit(1), so the subsequent raise SystemExit(1) is unreachable. Consider removing the redundant raise to avoid dead code and keep the control flow clear.

Copilot uses AI. Check for mistakes.
Copilot AI and others added 4 commits February 6, 2026 11:37
Co-authored-by: TB-1993 <109213741+TB-1993@users.noreply.github.com>
Co-authored-by: TB-1993 <109213741+TB-1993@users.noreply.github.com>
Co-authored-by: TB-1993 <109213741+TB-1993@users.noreply.github.com>
Co-authored-by: TB-1993 <109213741+TB-1993@users.noreply.github.com>
@TB-1993 TB-1993 force-pushed the copilot/fix-yamlrunner-alias-name branch from 3c1b16b to bdf9f62 Compare February 6, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants