zsh-workers
 help / color / mirror / code / Atom feed
From: Anton Shestakov <av6@dwimlabs.net>
To: zsh-workers@zsh.org
Cc: Anton Shestakov <av6@dwimlabs.net>
Subject: [PATCH 1/2] _hg: add completion of -S/--subrepos to many commands
Date: Wed, 22 Aug 2018 22:39:59 +0800	[thread overview]
Message-ID: <20180822144000.4736-1-av6@dwimlabs.net> (raw)

---
 Completion/Unix/Command/_hg | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg
index 2b2d3c4ec..99cbd1742 100644
--- a/Completion/Unix/Command/_hg
+++ b/Completion/Unix/Command/_hg
@@ -405,18 +405,22 @@ _hg_remote_opts=(
   '--insecure[do not verify server certificate (ignoring web.cacerts config)]'
 )
 
+_hg_subrepos_opts=(
+  '(--subrepos -S)'{-S,--subrepos}'[recurse into subrepositories]'
+)
+
 _hg_cmd() {
   _call_program hg hg --config ui.verbose=0 --config defaults."$1"= \
     "$_hg_cmd_globals[@]" "$@" 2> /dev/null
 }
 
 _hg_cmd_add() {
-  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts $_hg_subrepos_opts \
   '*:unknown files:_hg_unknown'
 }
 
 _hg_cmd_addremove() {
-  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts $_hg_subrepos_opts \
   '(--similarity -s)'{-s+,--similarity=}'[guess renamed files by similarity (0<=s<=100)]:similarity' \
   '*:unknown or missing files:_hg_addremove'
 }
@@ -436,7 +440,7 @@ _hg_cmd_annotate() {
 }
 
 _hg_cmd_archive() {
-  _arguments -s -S : $_hg_global_opts $_hg_pat_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
   '--no-decode[do not pass files through decoders]' \
   '(--prefix -p)'{-p+,--prefix=}'[directory prefix for files in archive]:prefix' \
   '(--rev -r)'{-r+,--rev=}'[revision to distribute]:revision:_hg_tags' \
@@ -517,7 +521,7 @@ _hg_cmd_clone() {
 }
 
 _hg_cmd_commit() {
-  _arguments -s -S : $_hg_global_opts $_hg_pat_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
   '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
   '(--message -m)'{-m+,--message=}'[specify commit message]:text' \
   '(--logfile -l)'{-l+,--logfile=}'[read commit message from specified file]:log file:_files' \
@@ -541,7 +545,7 @@ _hg_cmd_diff() {
   local context state state_descr line ret=1
   typeset -A opt_args
 
-  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts $_hg_subrepos_opts \
   '*'{-r+,--rev=}'[revision]:revision:_hg_revrange' \
   '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
   '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \
@@ -630,7 +634,7 @@ _hg_cmd_import() {
 }
 
 _hg_cmd_incoming() {
-  _arguments -s -S : $_hg_global_opts $_hg_remote_opts $_hg_template_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_remote_opts $_hg_template_opts $_hg_subrepos_opts \
   '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   '(--patch -p)'{-p,--patch}'[show patch]' \
@@ -683,7 +687,7 @@ _hg_cmd_merge() {
 }
 
 _hg_cmd_outgoing() {
-  _arguments -s -S : $_hg_global_opts $_hg_remote_opts $_hg_template_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_remote_opts $_hg_template_opts $_hg_subrepos_opts \
   '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   '(--patch -p)'{-p,--patch}'[show patch]' \
@@ -732,7 +736,7 @@ _hg_cmd_push() {
 }
 
 _hg_cmd_remove() {
-  _arguments -s -S : $_hg_global_opts $_hg_pat_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
   '(--after -A)'{-A,--after}'[record delete for missing files]' \
   '(--force -f)'{-f,--force}'[forget added files, delete modified files]' \
   '*:file:_hg_files'
@@ -793,7 +797,7 @@ _hg_cmd_revert() {
 }
 
 _hg_cmd_serve() {
-  _arguments -s -S : $_hg_global_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_subrepos_opts \
   '(--accesslog -A)'{-A+,--accesslog=}'[name of access log file to write to]:log file:_files' \
   '(--errorlog -E)'{-E+,--errorlog=}'[name of error log file to write to]:log file:_files' \
   '(--daemon -d)'{-d,--daemon}'[run server in background]' \
@@ -821,7 +825,7 @@ _hg_cmd_showconfig() {
 }
 
 _hg_cmd_status() {
-  _arguments -s -S : $_hg_global_opts $_hg_pat_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
   '(--all -A)'{-A,--all}'[show status of all files]' \
   '(--modified -m)'{-m,--modified}'[show only modified files]' \
   '(--added -a)'{-a,--added}'[show only added files]' \
-- 
2.11.0


             reply	other threads:[~2018-08-22 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 14:39 Anton Shestakov [this message]
2018-08-22 14:40 ` [PATCH 2/2] _hg: suggest merge tools for -t/--tool Anton Shestakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180822144000.4736-1-av6@dwimlabs.net \
    --to=av6@dwimlabs.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).