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
Copy file name to clipboardExpand all lines: etc/hub.fish_completion
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
complete -c hub --wraps git
2
+
1
3
function __fish_hub_needs_command
2
4
set cmd (commandline -opc)
3
5
if [ (count $cmd) -eq 1 ]
@@ -9,12 +11,17 @@ end
9
11
10
12
function __fish_hub_using_command
11
13
set cmd (commandline -opc)
12
-
if [ (count $cmd) -gt 1 ]
13
-
if [ $argv[1] = $cmd[2] ]
14
-
return 0
14
+
set subcmd_count (count $argv)
15
+
if [ (count $cmd) -gt "$subcmd_count" ]
16
+
for i in (seq 1 "$subcmd_count")
17
+
if [ "$argv[$i]" != $cmd[(math "$i" + 1)] ]
18
+
return 1
19
+
end
15
20
end
21
+
return 0
22
+
else
23
+
return 1
16
24
end
17
-
return 1
18
25
end
19
26
20
27
complete -f -c hub -n '__fish_hub_needs_command' -a alias -d "show shell instructions for wrapping git"
@@ -24,7 +31,7 @@ complete -f -c hub -n '__fish_hub_needs_command' -a create -d "create new repo o
24
31
complete -f -c hub -n '__fish_hub_needs_command' -a delete -d "delete a GitHub repo"
25
32
complete -f -c hub -n '__fish_hub_needs_command' -a fork -d "fork origin repo on GitHub"
26
33
complete -f -c hub -n '__fish_hub_needs_command' -a pull-request -d "open a pull request on GitHub"
27
-
complete -f -c hub -n '__fish_hub_needs_command' -a pr -d "list or checkout a GitHub release"
34
+
complete -f -c hub -n '__fish_hub_needs_command' -a pr -d "list or checkout GitHub pull requests"
28
35
complete -f -c hub -n '__fish_hub_needs_command' -a issue -d "list or create a GitHub issue"
29
36
complete -f -c hub -n '__fish_hub_needs_command' -a release -d "list or create a GitHub release"
30
37
complete -f -c hub -n '__fish_hub_needs_command' -a ci-status -d "display GitHub Status information for a commit"
@@ -44,6 +51,19 @@ complete -f -c hub -n ' __fish_hub_using_command pull-request' -s h -d 'The head
44
51
complete -f -c hub -n ' __fish_hub_using_command pull-request' -s a -d 'A comma-separated list of GitHub handles to assign to this pull request'
45
52
complete -f -c hub -n ' __fish_hub_using_command pull-request' -s M -d "The milestone name to add to this pull request. Passing the milestone number is deprecated."
46
53
complete -f -c hub -n ' __fish_hub_using_command pull-request' -s l -d "Add a comma-separated list of labels to this pull request"
54
+
# pr
55
+
complete -f -c hub -n ' __fish_hub_using_command pr' -l color -xa 'always never auto' -d 'enable colored output even if stdout is not a terminal. WHEN can be one of "always" (default for --color), "never", or "auto" (default).'
56
+
## pr list
57
+
complete -f -c hub -n ' __fish_hub_using_command pr' -a list -d "list pull requests in the current repository"
58
+
complete -f -c hub -n ' __fish_hub_using_command pr list' -s s -l state -xa 'open closed merged all' -d 'filter pull requests by STATE. default: open'
59
+
complete -f -c hub -n ' __fish_hub_using_command pr list' -s h -l head -d 'show pull requests started from the specified head BRANCH in "[OWNER:]BRANCH" format'
60
+
complete -f -c hub -n ' __fish_hub_using_command pr list' -s b -l base -d 'show pull requests based off the specified BRANCH'
complete -f -c hub -n ' __fish_hub_using_command pr list' -s f -l format -d 'pretty print the list of pull requests using format FORMAT (default: "%pC%>(8)%i%Creset %t% l%n")'
64
+
complete -f -c hub -n ' __fish_hub_using_command pr list' -s L -l limit -d 'display only the first LIMIT issues'
65
+
## pr checkout
66
+
complete -f -c hub -n ' __fish_hub_using_command pr' -a checkout -d "check out the head of a pull request in a new branch"
47
67
# fork
48
68
complete -f -c hub -n ' __fish_hub_using_command fork' -l no-remote -d "Skip adding a git remote for the fork"
0 commit comments