From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4527 invoked by alias); 24 Sep 2015 16:17:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36617 Received: (qmail 6993 invoked from network); 24 Sep 2015 16:17:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=I3UGTJTO8fMhIouLkMS1DPCxgBM=; b=ZReTbs fxW7FeIKfSc0slNrcSXSey6ZMxTBS4zkZaCXMcuxHwX4iAhJAvH4A+WzZB4RpVoJ /YIPEG5KjsXrcA2+TtzEazqZ4UlrnqU5v6ahQm4IifJcaI1VE19lI5k45ZEHVjkO LLraQo4aM810u3SOBNC9uoAoXaFcGbUYm/FRI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=I3UGTJTO8fMhIouLkMS1DPCxgBM=; b=YGGiL iinc0UtqNjMeD6yZdVdAuj+7hkDplT1o7Sji/4uCq0fgZuZVAh2xUc7repFttbxb zjc7d0QCW4nSeJcRzELSBNFaFMBV8V2ekCAm81A5yfsWxWQJSspy7uZ3zfGiwB5s mGq/2/4Mpd1f5N0GJG/sMDnASvj7o/Y3bIHgxo= X-Sasl-enc: MKHzHJD5z0fZW6RkiV0IOqI2COFS+7javs7BeodCRU/F 1443110752 Date: Thu, 24 Sep 2015 16:05:50 +0000 From: Daniel Shahaf To: Christoph Mathys Cc: zsh-workers@zsh.org Subject: Re: [patch] _hg: completion for 'hg bookmarks' Message-ID: <20150924160550.GD1906@tarsus.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Christoph Mathys wrote on Thu, Sep 24, 2015 at 16:23:51 +0200: > Hi there > > Below is a patch to add completion support for the "hg bookmarks" command. > Thanks! A few comments: 1. The function should be defined further up in the file (_hg_cmd_* are defined alphabetically). 2. --rev and --message need to become --rev= and --message= to allow both '--rev ARG' and '--rev=ARG' (which both work). 3. Why do you have a leading '-' on the first and last line? Is it intentional? 4. How should positional arguments (i.e., 'hg bookmarks ') be completed? They are currently completed as files; presumably they should be completed as _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. Thanks, Daniel > thg, > Christoph > > PS Please CC on reply, I'm not subscribed to the list. > > diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg > index e7c21b9..edd7f0d 100644 > --- a/Completion/Unix/Command/_hg > +++ b/Completion/Unix/Command/_hg > @@ -962,4 +962,14 @@ _hg_cmd_strip() { > ':revision:_hg_tags' > } > > +_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' \ > + ':bookmark:_hg_bookmarks_internal' \ > + - '(--inactive -i)'{-i,--inactive}'[mark a bookmark inactive]' > +} > + > _hg "$@"