From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24149 invoked by alias); 7 Oct 2014 15:35:12 -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: 33377 Received: (qmail 2944 invoked from network); 7 Oct 2014 15:35:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1412695733; bh=inKTQ8Wvmmful7uE7ZJSjxHuhDB5eBhJZbrb5/FevIU=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:cc:In-reply-to:From:References:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=vbfr/lXF7wkzlOPybgTFlVKZu/Tvj3k6ZUSER82P2js+mMQ6sNcmTzPE0e7rw7bO9Gqb5JVwlx3j14ikFb3WfnCc7BDegERjmN79e8K3EtKhz+Gh+/+INSgwgbT/2OTDOUCbfnTHAsBN55T2a3tPUPj8Zq0tEKxUPsYXwrZrO9Y= X-Yahoo-Newman-Id: 900939.20597.bm@smtp133.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Amfo1QIVM1k8OCADOrOwmIJdCSzaeQwL6PsL._32xGFL7Fo EHiOLky15gxu1tb_7R49_5V7msVgNKmw9fCBKiiziDmLheVUofzCE0gI69I9 95u8vXjzrezEEK0ilaTobRoDk.fMJ4NVsnYqKYoBMfxx3KfwAYOqQhO7N71X uLGEFE.TqnhgZy4x_BptSHRjsyQYCmNCwP8rlHZXJNhtLe3uuyyqEdx1ptGw Gk5pKuxSO71wmQfpJzzNAKoFMLKA_5AGlSK3ID9876HPtS8eEJR6XiCgb9.c X7Xpt1zzHY95X0qdg0Fw5wlP2.oil2rdMvT2QdvxFTlfs.b.c5cSPT84yrV2 _wvAcukJ.DwJ6K_VIMlEiRij7S5XPsRwy_h7iPszsMp18Pi4ryLuJ_rvd6Yd rLyKZ2Q8BLYZUsMedZS24Bw75tvpJ9fXE91sEvwLrQHZf4Uq93R9a1n1csXI MjcLHOAD4C4eq.Gw0c9iWVM71lw33fnbN6FxyR.3FyJXAwnb75WFi9.SMWxT W3JCsu5XN2z1b9nEl1HBFOoMWfV4- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- cc: zsh-workers@zsh.org In-reply-to: <20141007132025.GA6252@gae-bulg.lan.mitsi.com> From: Oliver Kiddle References: <20141005200135.GD58824@wanderlust.lan.mitsi.com> <5624.1412624240@quattro> <20141007132025.GA6252@gae-bulg.lan.mitsi.com> To: fREW Schmidt Subject: Re: [PATCH] new completion for "sv" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26746.1412695732.1@thecus.kiddle.eu> Date: Tue, 07 Oct 2014 17:28:52 +0200 Message-ID: <26747.1412695732@thecus.kiddle.eu> fREW Schmidt wrote: > Ok, I think I did this right this time. Looks good. > ok, I switched it to use _alternative and 3 functions as seems to be > somewhat common in other compltion scripts in the codebase. At least based on the documentation, _alternative is supposed to take _arguments like specifications. Apparently it works with a list of functions as you have done. An example would be: _alternative \ 'additional-commands:additional command:((check\:check\ status\ of\ service))' \ 'lsb-commands: : _describe -t lsb-commands "LSB command" sv_lsb_ary' \ 'sv-commands:sv command:_sv_commands' > This raises an interesting question. I did what you said, but as > Christian Neukirchen pointed out, on his system the default SVDIR is > /var/service, and on ubuntu the default is /etc/service. I guess it's > up to the packager to tweak the script or something? I guess it could try to find out what distribution you have by checking for release files in /etc and choosing a suitable default accordingly. > Additionally, I like Christian Neukirchen's single-character shortcut > completion. For majority of the commands they work already since > nothing else starts with that letter, but s and c both have multiple > options. If I understood what I was doing more I'd take his idea, but > I don't. I'm not sure that I do like it because it is a departure from the way completion normally works: "s" will complete to status but not start or stop while "st" will offer all three. It is possible to configure this using tag-order and ignored-patterns styles. > Completion/Unix/Command/_sv | 73 +++++++++++++++++++++++++++++++++++++++++++++ One thing I forgot to mention is that it should be named _runit: functions are normally named after the software rather than the command, e.g. _subversion for svn. Oliver