Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
70ab2928
Unverified
Commit
70ab2928
authored
May 03, 2021
by
kalle (jag)
Committed by
GitHub
May 03, 2021
Browse files
feat(plugins): add `gh` plugin for GitHub CLI (#9557)
parent
63a7422d
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/gh/.gitignore
0 → 100644
View file @
70ab2928
_gh
plugins/gh/README.md
0 → 100644
View file @
70ab2928
# GitHub CLI plugin
This plugin adds completion for the
[
GitHub CLI
](
https://cli.github.com/
)
.
To use it, add
`gh`
to the plugins array in your zshrc file:
```
zsh
plugins
=(
... gh
)
```
This plugin does not add any aliases.
## Cache
This plugin caches the completion script and is automatically updated when the
plugin is loaded, which is usually when you start up a new terminal emulator.
The cache is stored at:
-
`$ZSH/plugins/gh/_gh`
completions script
-
`$ZSH_CACHE_DIR/gh_version`
version of GitHub CLI, used to invalidate
the cache.
plugins/gh/gh.plugin.zsh
0 → 100644
View file @
70ab2928
# Autocompletion for the GitHub CLI (gh).
if
((
$+
commands[gh]
))
;
then
if
[[
!
-r
"
$ZSH_CACHE_DIR
/gh_version"
\
||
"
$(
gh
--version
)
"
!=
"
$(
<
"
$ZSH_CACHE_DIR
/gh_version"
)
"
||
!
-f
"
$ZSH
/plugins/gh/_gh"
]]
;
then
gh completion
--shell
zsh
>
$ZSH
/plugins/gh/_gh
gh
--version
>
$ZSH_CACHE_DIR
/gh_version
fi
autoload
-Uz
_gh
_comps[gh]
=
_gh
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment