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

Zsh completion #868

Merged
merged 3 commits into from
Aug 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions etc/git-extras-completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ __gitex_author_names() {
}

# subcommands
# new subcommand should be added in alphabetical order
_git-authors() {
_arguments -C \
'(--list -l)'{--list,-l}'[show authors]' \
Expand Down Expand Up @@ -257,13 +258,10 @@ _git-ignore() {
}


_git-ignore() {
_git-info() {
_arguments -C \
'(--append -a)'{--append,-a}'[append .gitignore]' \
'(--replace -r)'{--replace,-r}'[replace .gitignore]' \
'(--list-in-table -l)'{--list-in-table,-l}'[print available types in table format]' \
'(--list-alphabetically -L)'{--list-alphabetically,-L}'[print available types in alphabetical order]' \
'(--search -s)'{--search,-s}'[search word in available types]'
'(--color -c)'{--color,-c}'[use color for information titles]' \
'--no-config[do not show list all variables set in config file, along with their values]'
}


Expand All @@ -280,6 +278,18 @@ _git-missing() {
':second-branch-name:__gitex_branch_names'
}

_git-release() {
_arguments -C \
'-c[Generates/populates the changelog with all commit message since the last tag.]' \
'-r[The "remote" repository that is destination of a push operation.]' \
'-m[use the custom commit information instead of the default message.]' \
'-s[Create a signed and annotated tag.]' \
'-u[Create a tag, annotated and signed with the given key.]' \
'--semver[If the latest tag in your repo matches the semver format requirement, you could increase part of it as the new release tag.]' \
'--no-empty-commit[Avoid creating empty commit if nothing could be committed.]' \
'--[The arguments listed after "--" separator will be passed to pre/post-release hook.]'
}

_git-squash() {
_arguments '--squash-msg[commit with the squashed commit messages]'
_arguments \
Expand Down Expand Up @@ -310,18 +320,6 @@ _git-summary() {
__gitex_commits
}

_git-release() {
_arguments -C \
'-c[Generates/populates the changelog with all commit message since the last tag.]' \
'-r[The "remote" repository that is destination of a push operation.]' \
'-m[use the custom commit information instead of the default message.]' \
'-s[Create a signed and annotated tag.]' \
'-u[Create a tag, annotated and signed with the given key.]' \
'--semver[If the latest tag in your repo matches the semver format requirement, you could increase part of it as the new release tag.]' \
'--no-empty-commit[Avoid creating empty commit if nothing could be committed.]' \
'--[The arguments listed after "--" separator will be passed to pre/post-release hook.]'
}

_git-undo(){
_arguments -C \
'(--soft -s)'{--soft,-s}'[only rolls back the commit but changes remain un-staged]' \
Expand Down