Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help users learn to quote arguments with spaces in their shell #756

Open
mislav opened this issue Apr 7, 2020 · 0 comments
Open

Help users learn to quote arguments with spaces in their shell #756

mislav opened this issue Apr 7, 2020 · 0 comments
Labels

Comments

@mislav
Copy link
Member

@mislav mislav commented Apr 7, 2020

Running this in a shell such as bash or zsh will not produce the sometimes-expected result of looking up issues under the help wanted label:

# doesn't work:
gh issue list -l help wanted

This is because the value help wanted should be quoted or escaped in one's shell to ensure that it's passed as a single value to --label, rather than as two distinct arguments help + wanted (where the latter wouldn't be interpreted as relating to --label at all):

# works:
gh issue list -l "help wanted"

# also works:
gh issue list -l help\ wanted

This isn't a bug with CLI, but is a common pitfall for shell-users in general that we could ideally help our users detect and recover from. Possible approaches:

  • Include example of passing labels with spaces in gh help issue list docs
  • Detect extra, unaccounted arguments to gh issue list ("wanted" in the above example) and present an error such as “unrecognized argument 'wanted': did you forget to quote values with spaces?”

Originally reported by @tierninho

Loosely related issues that stem as consequence of shell behavior (as opposed to being bugs in gh): #223 #595 #315

@vilmibm vilmibm added the docs label May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.