-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Make new zsh completion #132 #266
Conversation
Thanks for the contribution. Maybe add a folder and place both completion script there so people can choose? |
e544383
to
d109b6d
Compare
Do you want I move the bash completion version in bash folder? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #266 +/- ##
==========================================
+ Coverage 86.25% 86.38% +0.12%
==========================================
Files 5 5
Lines 793 793
==========================================
+ Hits 684 685 +1
+ Misses 109 108 -1 ☔ View full report in Codecov by Sentry. |
sure, thanks One minor suggestion: the folder structure can be simplified to |
OK to change the folder. I made that in case you have other contribution for other people. |
d109b6d
to
ca7a3fa
Compare
@@ -780,17 +780,18 @@ def main(argv=None): | |||
cmds = utils.get_cmds_from_files() | |||
for name, data in cmds.items(): | |||
help = data.get("help") | |||
repo_help = help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why split help
into two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the same help than before, I think the general help is too loaded.
But I can go back
Before
The general help : gita -hsub-commands:
{add,rm,freeze,clone,rename,flags,color,info,ll,context,ls,group,super,shell,clear,br,clean,diff,difftool,fetch,last,lo,log,merge,mergetool,patch,pull,push,rebase,reflog,remote,reset,show,stash,stat,st,tag}
additional help with sub-command -h
add add repo(s)
rm remove repo(s)
freeze print all repo information
clone clone repos
rename rename a repo
flags git flags configuration
color color configuration
info information setting
ll display summary of all repos
context set context
ls show repo(s) or repo path
group group repos
super run any git command/alias
shell run any shell command
clear removes all groups and repositories
br show local branches for the chosen repo(s) or group(s)
clean remove all untracked files/folders for the chosen repo(s) or group(s)
diff git show differences for the chosen repo(s) or group(s)
difftool show differences using a tool for the chosen repo(s) or group(s)
fetch fetch remote update for all repos or for the chosen repo(s) or group(s)
last show log information of HEAD for the chosen repo(s) or group(s)
lo show one-line log for the latest 7 commits for all repos or for the chosen repo(s) or group(s)
log show logs for the chosen repo(s) or group(s)
merge merge remote updates for the chosen repo(s) or group(s)
mergetool merge updates with a tool for the chosen repo(s) or group(s)
patch make a patch for the chosen repo(s) or group(s)
pull pull remote updates for all repos or for the chosen repo(s) or group(s)
push push the local updates for all repos or for the chosen repo(s) or group(s)
rebase rebase from master for the chosen repo(s) or group(s)
reflog show ref logs for the chosen repo(s) or group(s)
remote show remote settings for the chosen repo(s) or group(s)
reset reset repo(s) for the chosen repo(s) or group(s)
show show detailed commit information for the chosen repo(s) or group(s)
stash store uncommited changes for the chosen repo(s) or group(s)
stat show edit statistics for all repos or for the chosen repo(s) or group(s)
st show status for all repos or for the chosen repo(s) or group(s)
tag show tags for the chosen repo(s) or group(s)
a specific help :
gita st -h :
usage: gita st [-h] [-s SHELL] [{gita,artifactory-cleanup,arch-mu-repo,stackedit-docker,gitlab-branch-source-plugin,analyse_bonnes_pratiques,ul_cnes,open_source,} ...]
show status for all repos or for the chosen repo(s) or group(s)
positional arguments:
{gita,artifactory-cleanup,arch-mu-repo,stackedit-docker,gitlab-branch-source-plugin,analyse_bonnes_pratiques,ul_cnes,open_source,[]}
show status for all repos or for the chosen repo(s) or group(s)
options:
-h, --help show this help message and exit
-s SHELL, --shell SHELL
If set, run in shell mode
with my version :
After
general help : gita -hsub-commands:
{add,rm,freeze,clone,rename,flags,color,info,ll,context,ls,group,super,shell,clear,br,clean,diff,difftool,fetch,last,lo,log,merge,mergetool,patch,pull,push,rebase,reflog,remote,reset,show,stash,stat,st,tag}
additional help with sub-command -h
add add repo(s)
rm remove repo(s)
freeze print all repo information
clone clone repos
rename rename a repo
flags git flags configuration
color color configuration
info information setting
ll display summary of all repos
context set context
ls show repo(s) or repo path
group group repos
super run any git command/alias
shell run any shell command
clear removes all groups and repositories
br show local branches
clean remove all untracked files/folders
diff git show differences
difftool show differences using a tool
fetch fetch remote update
last show log information of HEAD
lo show one-line log for the latest 7 commits
log show logs
merge merge remote updates
mergetool merge updates with a tool
patch make a patch
pull pull remote updates
push push the local updates
rebase rebase from master
reflog show ref logs
remote show remote settings
reset reset repo(s)
show show detailed commit information
stash store uncommited changes
stat show edit statistics
st show status
tag show tags
a specific help :
gita st -h :
usage: gita st [-h] [-s SHELL] [{gita,artifactory-cleanup,arch-mu-repo,stackedit-docker,gitlab-branch-source-plugin,analyse_bonnes_pratiques,ul_cnes,open_source,} ...]
show status
positional arguments:
{gita,artifactory-cleanup,arch-mu-repo,stackedit-docker,gitlab-branch-source-plugin,analyse_bonnes_pratiques,ul_cnes,open_source,[]}
show status for all repos or for the chosen repo(s) or group(s)
options:
-h, --help show this help message and exit
-s SHELL, --shell SHELL
If set, run in shell mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, this is great
ca7a3fa
to
6791680
Compare
Hello everyone,
I have succeeded with the old zsh completion.
Adding in my .zshrc
But the completion is not Zsh style and seems very limited.
I propose a new zsh completion.
It's my second completion zsh script. So be nice and give me pointers if I'm wrong.
I find the completion nicer and dynamic depending your configuration. By exemple, it display your repositories or your groups.
To me, it miss 2 things :
gita color set <TAB>
displaying the possible colors.gita group add
command. I don't know if options-n
and-p
are exclusive? Easy to correct. I just have to knowOther problem. If the community doesn't know zsh completion. It is probably complex to maintain.
Maybe, I'll propose this completion to other repository like https://github.com/zsh-users/zsh-completions if @nosarthur doesn't want this PR.