You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh alias set beanissue '!sh -c "gh issue list | grep beans"'
Seeing the ! prefix on an alias would bypass any checking for correct commands, leaving that in the
hands of the user. Otherwise these should be printable and shareable and deletable just like the
other style of alias.
Considerations
Should have an affordance (either just a documented pattern or editor mode) for multiline alias
expansions
Should generally mirror git's alias implementation
What's a shell alias? It's like doing this in git:
git alias beanlog "!sh -c 'git log | grep beans'"
Just a small correction: I don't think there is a git alias command, at least there never was one for me 🤔 So wouldn't the git example be something like:
Furthermore, I would just like to warn that enclosing a ! character in double quotes in bash is usually going to explode:
$ echo"!"
-bash: !: event not found
This is because ! is a special character that triggers history expansion in bash. It can be escaped with a backslash, but in that case the backslash isn't stripped (for some reason):
$ echo"\!"\!
I would recommend that we always enclose strings that contain a ! in single quotes rather than double quotes when showing usage examples, to ensure maximum portability:
Activity
mislav commentedon May 18, 2020
Just a small correction: I don't think there is a
git aliascommand, at least there never was one for me 🤔 So wouldn't the git example be something like:git config --global alias.beanlog "!sh -c 'git log | grep beans'"Furthermore, I would just like to warn that enclosing a
!character in double quotes in bash is usually going to explode:This is because
!is a special character that triggers history expansion in bash. It can be escaped with a backslash, but in that case the backslash isn't stripped (for some reason):I would recommend that we always enclose strings that contain a
!in single quotes rather than double quotes when showing usage examples, to ensure maximum portability:vilmibm commentedon May 19, 2020
ah thanks for pointing that out; my brain was inventing syntax ^_^