zsh-workers
 help / color / mirror / code / Atom feed
From: Christoph Mathys <eraserix@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: [patch] _hg: completion for 'hg bookmarks'
Date: Fri, 25 Sep 2015 09:14:46 +0200	[thread overview]
Message-ID: <CALqGcGqGeQCYduM_0_omdoZksqxw+qfJP+1Fh425D4tpYqz58Q@mail.gmail.com> (raw)
In-Reply-To: <20150924160550.GD1906@tarsus.local2>

[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]

Hi Daniel,

Thank you for the quick response.

On Thu, Sep 24, 2015 at 6:05 PM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:

> 1. The function should be defined further up in the file (_hg_cmd_* are
> defined alphabetically).

Fixed.

> 2. --rev and --message need to become --rev= and --message= to allow
> both '--rev ARG' and '--rev=ARG' (which both work).

Fixed for --rev.

> 3. Why do you have a leading '-' on the first and last line?  Is it
> intentional?

They were intentional. I wanted to create groups of mutually exclusive
arguments. But on typing the reply I realized that it is very well
possible to call '--inactive <bookmark>', so the patch was wrong. I
have done away with the '-' in this version of the patch and it should
be more straightforward like this.

> 4. How should positional arguments (i.e., 'hg bookmarks <TAB>') be
> completed?  They are currently completed as files; presumably they
> should be completed as _hg_bookmarks_internal?

Should now always be _hg_bookmarks_internal.

> 5. Your mailer munged whitespace in the patch.  You should be able to
> avoid this by sending the patch as an attachment named *.txt.

Done.

thx,
Christophq

[-- Attachment #2: _hg_cmd_bookmarks.diff --]
[-- Type: text/plain, Size: 883 bytes --]

diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg
index 9dd0236..c84faf3 100644
--- a/Completion/Unix/Command/_hg
+++ b/Completion/Unix/Command/_hg
@@ -460,6 +460,16 @@ _hg_cmd_bisect() {
   '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]'
 }
 
+_hg_cmd_bookmarks() {
+  _arguments -s -w : $_hg_global_opts \
+  '(--force -f)'{-f,--force}'[force]' \
+  '(--rev -r)'{-r+,--rev=}'[set bookmark at revision]:revision:_hg_tags' \
+  '(--delete -d)'{-d,--delete}'[delete a given bookmark]' \
+  '(--rename -m)'{-m+,--rename}'[rename given bookmark]:bookmark:_hg_bookmarks_internal' \
+  '(--inactive -i)'{-i,--inactive}'[mark a bookmark inactive]' \
+  ':bookmark:_hg_bookmarks_internal'
+}
+
 _hg_cmd_branch() {
   _arguments -s -w : $_hg_global_opts \
   '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \

  parent reply	other threads:[~2015-09-25  7:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 14:23 Christoph Mathys
2015-09-24 16:05 ` Daniel Shahaf
2015-09-24 16:29   ` Bart Schaefer
2015-09-24 22:17     ` Daniel Shahaf
2015-09-25  7:14   ` Christoph Mathys [this message]
2015-09-25 23:18     ` Daniel Shahaf
2015-09-26  0:23       ` Daniel Shahaf

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=CALqGcGqGeQCYduM_0_omdoZksqxw+qfJP+1Fh425D4tpYqz58Q@mail.gmail.com \
    --to=eraserix@gmail.com \
    --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).