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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 f06fd32f for ; Thu, 23 May 2019 14:43:24 +0000 (UTC) Received: (qmail 8485 invoked by alias); 23 May 2019 14:43:08 -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: List-Unsubscribe: X-Seq: 44356 Received: (qmail 10260 invoked by uid 1010); 23 May 2019 14:43:08 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25454. spamassassin: 3.4.2. Clear:RC:0(205.235.26.22):SA:0(-1.9/5.0):. Processed in 2.45327 secs); 23 May 2019 14:43:08 -0000 X-Envelope-From: SRS0=C33n=TX=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at bounces.park01.gkg.net designates 205.235.26.22 as permitted sender) X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1558622545; bh=zzBny9lsdikFeXb1AdOvNfkRJ2E5K9FODbNuY3rhRCE=; h=From:To:Subject:Date:From:Subject; b=PJTRjJ+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0sZAA.JvKrr5uzSkc5y_Rb8uBJ7jtRoFf hpG6AzEyVL1cZ4RBzW27FlOPvGpSfb4drbG6ZawTGpJAG5C6h_N0PwNbMC8mBxi3NJhSYVasp2Eu Ck.tyr4Ks_8jcrK6XpvjQeWbv93WgHMk3e1RhW.5mvbDfrAWcq_qKX7NeVHKz83JqzOcAry9e_pJ .acEzfPpdwbfV7S.RXmXX92Ly3oCmUBmoRTWzOPVi7aymTFycGjbkOQOBj6OtVm_X5D2EkTkkXPn LsWv106iS2GlYEzG8jp5aY_rX2rFaMPaUYoLU2vvqRciXugOwrVE82H6BBODF2bT1Hd6Vq_tQ9jo KUnp48QgGA6Mtwc1eiTxMCPUshptP3UMl0I4O8ZagsS6NDqEP9QFwt9IegLaN55PystAjpjnngxO Fixn8dKHILWyTBK4iQT2ur931NT5X2PvFVesJUywJ8yKUDoOy29PaHS.1ogqwB.ypwBTHZ0UBNq4 .Py.POabpHB.NuRUC01k- From: Oliver Kiddle To: Zsh workers Subject: PATCH: ansible environment variable completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <43159.1558622540.1@hydra> Date: Thu, 23 May 2019 16:42:20 +0200 Message-ID: <43160-1558622540.972414@q7gc.BJmo.SMIp> ansible looks at quite a large number of environment variables but for my uses, I needed to set ANSIBLE_STDOUT_CALLBACK. This makes it complete callback plugins for that. Oliver diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index 89a4998b7..a6e586da3 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -1,10 +1,14 @@ -#compdef ansible ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-playbook ansible-pull ansible-vault +#compdef ansible ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-playbook ansible-pull ansible-vault -value-,ANSIBLE_STDOUT_CALLBACK,-default- local curcontext="$curcontext" plug plugvar ign ret=1 local -a args state line local -A opt_args case $service in + *,ANSIBLE_STDOUT_CALLBACK,*) + plug=callback + state=plugins + ;; ansible|ansible-console|ansible-doc|ansible-playbook) args=( \*{-M+,--module-path=}'[specify path to modules]:module path:_dir_list' @@ -30,7 +34,7 @@ case $service in '(-D --diff)'{-D,--diff}'[show differences when changing small files and templates]' '(-b --become)'{-b,--become}'[escalate privileges on remote system]' '(-f --forks)'{-f+,--forks=}'[specify number of parallel processes to use]:processes [5]' - '--become-method=[specify privilege escalation method to use]:method [sudo]:(sudo su pbrun pfexec doas dzdo ksu runas pmrun enable machinectl)' + '--become-method=[specify privilege escalation method to use]:method [sudo]:(sesu sudo su pbrun pfexec doas dzdo ksu runas pmrun enable machinectl)' '--become-user=[specify remote user for running operations]:user:_users' "--syntax-check[perform a syntax check on the playbook, but don't execute it]" '!(-R --su-user -U --sudo-user)'{-R,-U,--su-user,--sudo-user}':user [root]:_users' @@ -170,12 +174,15 @@ case $service in esac (( $#words > 2 )) && ign='!' -_arguments -s -S -C $args \ - "${ign}(- :)--version[display version information]" \ - "${ign}(- :)"{-h,--help}'[display usage information]' \ - \*{-v,--verbose}"[verbose mode (repeat to increase)]" && ret=0 +if (( $#args )); then + _arguments -s -S -C $args \ + "${ign}(- :)--version[display version information]" \ + "${ign}(- :)"{-h,--help}'[display usage information]' \ + \*{-v,--verbose}"[verbose mode (repeat to increase)]" && ret=0 + + plug=${(v)opt_args[(i)-(t|-type)]:-module} +fi -plug=${(v)opt_args[(i)-(t|-type)]:-module} case $state in args) case ${(v)opt_args[(I)-(m|module)]} in