git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[TopGit PATCH] tg-push: add bash completion

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
May 26, 2009, 22:37 UTC
Message-ID
<1243377428-27546-1-git-send-email-bert.wesarg@googlemail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 contrib/tg-completion.bash |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/contrib/tg-completion.bash b/contrib/tg-completion.bash
index de8a7b5..5b9ef31 100755
--- a/contrib/tg-completion.bash
+++ b/contrib/tg-completion.bash
@@ -370,6 +370,26 @@ _tg_patch ()
 	esac
 }
 
+_tg_push ()
+{
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+
+	__tg_complete_arg "-r" && {
+		__tgcomp "$(__tg_remotes)"
+		return
+	}
+
+	case "$cur" in
+	-*)
+		__tgcomp "
+			-r
+		"
+		;;
+	*)
+		__tgcomp "$(__tg_topics)"
+	esac
+}
+
 _tg_remote ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -449,6 +469,7 @@ _tg ()
 	info)        _tg_info ;;
 	mail)        _tg_mail ;;
 	patch)       _tg_patch ;;
+	push)        _tg_push ;;
 	remote)      _tg_remote ;;
 	summary)     _tg_summary ;;
 	update)      _tg_update ;;
-- 
tg: (b725fc9..) bw/push-completion (depends on: master)
Next: Bert Wesarg
Message 1 of 3 in “tg-push: add bash completion”
  1. tg-push: add bash completionBert Wesarg, May 26, 2009
  2. tg-push: add bash completionBert Wesarg, May 26, 2009
  3. Bert WesargJun 2, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.