From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 1981582c for ; Mon, 2 Sep 2019 15:57:34 +0000 (UTC) Received: (qmail 13021 invoked by alias); 2 Sep 2019 15:57:27 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24198 Received: (qmail 27645 invoked by uid 1010); 2 Sep 2019 15:57:27 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f41.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25559. spamassassin: 3.4.2. Clear:RC:0(209.85.217.41):SA:0(-2.0/5.0):. Processed in 3.23718 secs); 02 Sep 2019 15:57:27 -0000 X-Envelope-From: pierpaolog@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.41 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Kn6HIUz2E1SCc9hEbHwV5AyycGjKqUN4+Es4KkmGyT4=; b=D9VuSfmq0p48Q6GpGr/7BUsv3LYb9oueDdm2P8WH+QwQ1SUhS3cTm97ua9dT2zGbQW 4dL7giSKnXAMqu1lNuWNw/dPTJ3Fzr4Rlx206+Tx99wNkMNoN7k30IwtcW5gARhdlNmI 71E4zMkHuTAPOpHmoo8iimj861Vk01lzOQNpdxcYO5J/Rq9L3jXNnypst72EI3+zfkO+ MT2DWwX4TzglU1BAR7ZhWibzjYE5JFVqEKaEJIsxFVjpkkm+Bq/L3D9OAYJKqhGdo2e+ A5HCtyugIT32jmo2Fb7tCL2T4HEXz7stmigDJ6iGOZI0WSX9ZhDeA4pAvTUZ225a3xem U3lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Kn6HIUz2E1SCc9hEbHwV5AyycGjKqUN4+Es4KkmGyT4=; b=oNDWxJDRyWVhV/bI8VM7oMhK2ETQEZxlhnXezovJPICigryHvP3jpkIdEEmqNTCwNu 9dDnWLJlhkrM/D5fhTTB2rs/KS8cYAnV1mjphgPE4Cfh2RJNP3EniCJ7b9TgSffbPSZ/ f+BcyHwuXttTRg7I3gcacbWjZmK+Szgqy0BAGuzNenUl1Eks0yCbZI+kTfNkFleNcko6 Y1yYVepp0sdnNqhrT2C6I79OKmpTEoQ6O+AUwIiK9iuhtRLCadFvR1E+wd5zLNpvJpZp +RYjKr5ptRkJpZdACGCRPtN3er3RAbuMfZNOVcQE7/Tc/yawxu1ory94uDrkFEZwpIKv TnXw== X-Gm-Message-State: APjAAAUDxUczYEaAz4jDanNF/m0xDv8XDysaG/YrWMXAM2RaKhJrpctn oAqfhR1cVOljvKN55rtpLbYoKkFLF7/P/+8Ci8xc96Of X-Google-Smtp-Source: APXvYqx9QUr1jYpjnxFdCXiYiy7TGOsRJBOwn/AEY0cWjs1QaTnPbBmlYhA2kIY/7skshl6dwf8g1b2IOfVmatTb8v0= X-Received: by 2002:a67:ad1a:: with SMTP id t26mr16022461vsl.57.1567439809785; Mon, 02 Sep 2019 08:56:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Mon, 2 Sep 2019 17:56:13 +0200 Message-ID: Subject: Re: sub-command completion To: Zsh-Users List Content-Type: multipart/alternative; boundary="00000000000011b58d0591940574" --00000000000011b58d0591940574 Content-Type: text/plain; charset="UTF-8" Sorry for the previous posting, the mail I wanted to ask again for suggestions is the one quoted here any help appreciated, thanks! Pier Paolo Grassi linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217 founder: https://www.meetup.com/it-IT/Machine-Learning-TO Il giorno gio 29 ago 2019 alle ore 11:48 Pier Paolo Grassi < pierpaolog@gmail.com> ha scritto: > Hello, I am trying to understand if it is possible to control the behavior > of _gnu_generic completion. > I have a command which defines different options if a non-option first > argument has already been inserted on the command line, eg: > > command -x -y sub-command > > I have defined a custom completion function like this: > > <----- CODE > # omissis code to populate the vars description_array and commands_array > > if [[ ${words[-1]} == -* ]] > then > _gnu_generic > else > _arguments -s -S -A '-*' \ > "1:commands:->commands" \ > "*:files:_files" > fi > > case $state in > (commands) > compadd -V commands -a -l -d description_array -Q -U commands_array > ;; > esac > > CODE -----> > > Now I would like to make _gnu_generic complete with the options offered by: > > command subcommand --help > > when a subcommand has already been inserted on the command line. But I > can't figure out how to do so, can anyone help me out? > > thanks > > Pier Paolo Grassi > linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217 > founder: https://www.meetup.com/it-IT/Machine-Learning-TO > --00000000000011b58d0591940574--