File: gitubuntu-completion.sh

package info (click to toggle)
git-ubuntu 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,688 kB
  • sloc: python: 13,378; sh: 480; makefile: 2
file content (123 lines) | stat: -rw-r--r-- 1,818 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
SNAP_GIT_BASH_COMPLETION="/snap/git-ubuntu/current/usr/share/bash-completions/completions/git"
if [ -f $SNAP_GIT_BASH_COMPLETION ]; then
	. $SNAP_GIT_BASH_COMPLETION
fi

_git_ubuntu ()
{
	local subcommands="
		clone
		import
		merge
		queue
		remote
		submit
		tag
		"
	local all_opts="
		-h --help
		-l --pullfile
		-v --verbose
		-p --parentfile
		"
	local net_opts="
		--proto
		--retries
		--retry-backoffs
		"
	local subcommand="$(__git_find_on_cmdline "$subcommands")"
	if [ -z "$subcommand" ]; then
		__gitcomp "
			$subcommands
			$all_opts
			"
		return
	fi

	case "$subcommand,$cur" in
		clone,--*)
			__gitcomp "
				-l --lp-user
				$all_opts
				$net_opts
				"
			;;
		import,--*)
			__gitcomp "
				--active-series-only
                                --allow-applied-failures
				-d --directory
				--dl-cache
				-o --lp-owner
				-l --lp-user
				--no-clean
				--no-fetch
				--no-push
				--reimport
				--skip-applied
				--skip-orig
				$all_opts
				$net_opts
				"
			;;
		merge,--*)
			__gitcomp "
				start
				finish
				--bug
				-d --directory
				-f --force
				--release
				--tag-only
				$all_opts
				"
			;;
		queue,--*)
			__gitcomp "
				clean
				sync
				-d --directory
				--new
				--no-fetch
				--no-trim
				--orphan
				--parent
				--series
				--source
				--unapproved
				$all_opts
				$net_opts
				"
			;;
		remote,--*)
			__gitcomp "
				add
				-d --directory
				-l --lp-user
				--no-fetch
				--package
				-r --remote-name
				$all_opts
				$net_opts
				"
			;;
		tag,--*)
			__gitcomp "
				--bug
				-d --directory
				--split
				--format
				--logical
				--print-name-only
				--reconstruct
				--upload
				--force
				$all_opts
				"
			;;
	esac
}

if [ -a "`type -t __git_find_on_cmdline`" ]; then
	alias __git_find_on_cmdline=__git_find_subcommand
fi