completion: add missing general options

And add relevant tests. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Apr 15, 2012 at 22:44 UTC 69ef3c0296e173535b73c7376469a722d54681f2
2 files changed +18
contrib/completion/git-completion.bash
+2
@@ -2640,8 +2640,10 @@ _git ()
2640 --version
2641 --exec-path
2642 --html-path
2643 + --info-path
2644 --work-tree=
2645 --namespace=
2646 + --no-replace-objects
2647 --help
2648 "
2649 ;;
t/t9902-completion.sh
+16
@@ -180,8 +180,10 @@ test_expect_success 'double dash "git" itself' '
180 --version Z
181 --exec-path Z
182 --html-path Z
183 + --info-path Z
184 --work-tree=
185 --namespace=
186 + --no-replace-objects Z
187 --help Z
188 EOF
189 test_completion "git --"
@@ -202,4 +204,18 @@ test_expect_success 'double dash "git checkout"' '
204 test_completion "git checkout --"
205 '
206
207 +test_expect_success 'general options' '
208 + test_completion "git --ver" "--version " &&
209 + test_completion "git --hel" "--help " &&
210 + test_completion "git --exe" "--exec-path " &&
211 + test_completion "git --htm" "--html-path " &&
212 + test_completion "git --pag" "--paginate " &&
213 + test_completion "git --no-p" "--no-pager " &&
214 + test_completion "git --git" "--git-dir=" &&
215 + test_completion "git --wor" "--work-tree=" &&
216 + test_completion "git --nam" "--namespace=" &&
217 + test_completion "git --bar" "--bare " &&
218 + test_completion "git --inf" "--info-path " &&
219 + test_completion "git --no-r" "--no-replace-objects "
220 +'
221 test_done