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 5af4f6f5 for ; Thu, 29 Aug 2019 09:49:45 +0000 (UTC) Received: (qmail 15339 invoked by alias); 29 Aug 2019 09:49:35 -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: 24192 Received: (qmail 15543 invoked by uid 1010); 29 Aug 2019 09:49:35 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua1-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25552. spamassassin: 3.4.2. Clear:RC:0(209.85.222.45):SA:0(-2.0/5.0):. Processed in 3.289975 secs); 29 Aug 2019 09:49:35 -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.222.45 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=NdYCApz2AuHwKcblt35i7P5oDxATzP03hARV29qTjYE=; b=Kw4WdvqjT7NpJeAxfFIQabeTcgOWrfmKdG7tE+jXAcAeTMoFq0PfivSjEOTeO/XiCy PKCIxOwWtldVnXMu2NEhrtRAI1JYItmtYamDzxa+ZNY+LRgT1k3I88B9RNSwuCvyDkCb WFkb/Fo3FZhNEn3N8ZUMXraltWwrgBnOh1KdVxy2CdGJq52zZDxk115mFODoJSw4zwqf YU2CbsKMciS5ZA6dNUUAsr5L6PoJcmvZ0L2aK6QunNRnwhJtJGyQX5b+7H9W2qZp0vPG 4Jasvshxv0sryKAhbC1xYmjXJkZsmAExGGVeuncMlWsgkU09/5cjhwkUkEAIUhs32Liu WmFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=NdYCApz2AuHwKcblt35i7P5oDxATzP03hARV29qTjYE=; b=EfG5exZ7STxw1L42icmcMUsA2Q1Fc1j1lJyYpmFVtCF82YrHPW9dVGd39YOuG0LdPQ DBmokuX5sQqjOb3PRZoMwyc83AV8sbOjBJ/X+5memJvqHY3GsG3S1Og8rbYPFC3WphpF cvuvx1rSj0iHJSd4VvK92CmhTKDaO8/AvcpbwZTK/BlkG2CLYvTm/Zight/UAWK+YRYa LvgfEVhazPOEEiPrfPyQRoOVprQ/cmiqxqyH/q6q+FEbZLuE0Mgr1gVQ9nrNDskRmsyv iVgfXn/42BLZFI54jBhJK6WOt/kowjU923WjtEOggxGZU9kcEpjH0cMEi8F4K9h5fm2/ VrVQ== X-Gm-Message-State: APjAAAUboyxWvUFAg46tDnMrx7v2peo0T+PQDtXa8ysFsWoPsdNEnPbZ II63s0DDX5X6CZgOksh1ZJmmripgsJjE/BhCoo81iNTE X-Google-Smtp-Source: APXvYqxC/4TKOLuU1DbpNcwH33/axuRJzqq1lmTQ7miZcGO4SbTx5Q9spbeYbCK/FU6IyR5qxpSm2GDyHepWJ6l+Nj0= X-Received: by 2002:ab0:340c:: with SMTP id z12mr4320079uap.30.1567072138112; Thu, 29 Aug 2019 02:48:58 -0700 (PDT) MIME-Version: 1.0 From: Pier Paolo Grassi Date: Thu, 29 Aug 2019 11:48:22 +0200 Message-ID: Subject: sub-command completion To: Zsh-Users List Content-Type: multipart/alternative; boundary="0000000000002134c505913e6a67" --0000000000002134c505913e6a67 Content-Type: text/plain; charset="UTF-8" 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 --0000000000002134c505913e6a67--