github / gh-copilot

Ask for assistance right in your terminal.

Home Page:https://docs.github.com/en/copilot/github-copilot-in-the-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: `ghcs --target` doesn't work the same as `gh copilot suggest --target`

williammartin opened this issue · comments

What happened?

Compare the following two snippets providing the --target flag to the suggest command and alias:

➜ gh copilot suggest --target git

Welcome to GitHub Copilot in the CLI!
version 1.0.1 (2024-03-22)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency

? What would you like the git command to do?
>
➜  ~ ghcs --target git

✗ Error: invalid argument "" for "-t, --target" flag: invalid target choice:  is not one of shell, gh, git

The zsh alias (haven't checked the others) expects --target=git with the equals sign as a separator, but this acts differently from the go binary command, which is surprising. The short flag works as expected.

Versions

➜  ~ gh copilot --version
version 1.0.1 (2024-03-22)