From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 91C0F2131A for ; Mon, 18 Mar 2024 21:11:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=o7a0qx/SP//9z3UxU9d5aEH5+wodWCGqTXPkzICjnQ8=; b=os0YOBgDQ2y4Ciyl3z6JMHBaq5 gVQv0ctBxQFQrf64I2I3jHJx2YGGbCV/Dc/i5C1/UBZbHvoz+tbBP9WSxRvdkGY1Br9weurMO0vKR YX1evzuERhiD4WFo5cqiCi//yyzntGq77mZhh+oaVhV7uY53gxblVTqj8RdByJ8CZrdL4vLmXAqtm X1/nYdYIG/iEStSfwZwdmYTd9ti19LWV0jxZ3WXL5f1vPEJaLVNTspPdJvcyBmNw34VieqkdxUOiq WYaJwlCHCxxJdCQeb7Gf8ldbXydpvqtHWjbfL7UkmyVVg9P6Qeqpko4Y4vmpTVJfoYbHSue92IrX3 a9tsDRig==; Received: by zero.zsh.org with local id 1rmJKX-000KUW-Mo; Mon, 18 Mar 2024 20:11:33 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rmJJw-000K8p-WF; Mon, 18 Mar 2024 20:10:57 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.97.1) (envelope-from ) id 1rmJJv-000000008Ry-1Hdt for zsh-workers@zsh.org; Mon, 18 Mar 2024 21:10:55 +0100 From: Oliver Kiddle To: Zsh workers Subject: PATCH: handle keywords in ansible-doc completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32484.1710792655.1@hydra> Date: Mon, 18 Mar 2024 21:10:55 +0100 Message-ID: <32485-1710792655.301933@5q5c.sOTD.WMKT> X-Seq: 52769 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: When listing available keywords, a trailing colon is included which is unwanted when passing a particular keyword to ansible-doc. This stips the trailing colon. Also, --step is valid for ansible-playbook and had got left out. Oliver diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index bf31819ad..e0d9fb9b6 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -69,6 +69,11 @@ case $service in "--skip-tags[only run plays and tasks whose tags don't match]" ) ;| + ansible-playbook|ansible-console) + args+=( + '--step[one-step-at-a-time: confirm each task before running]' + ) + ;| ansible|ansible-console) args+=( '--task-timeout[set the task timeout limit]:timeout (seconds)' @@ -97,11 +102,6 @@ case $service in '*::args:->config' ) ;; - ansible-console) - args+=( - '--step[one-step-at-a-time: confirm each task before running]' - ) - ;; ansible-doc) args+=( '!--metadata-dump' '!--no-fail-on-errors' # "internal use only" @@ -440,11 +440,11 @@ if [[ $state = plugins ]]; then typeset -ga ${plug} if zstyle -T ":completion:${curcontext}:plugins" verbose; then (( ${(P)#plugvar} )) || set -A ${plugvar} \ - ${${(f)"$(_call_program plugins ansible-doc -t $plug -l)"}/ ##/:} + ${${${(f)"$(_call_program plugins ansible-doc -t $plug -l)"}:# *}/(:|) ##/:} _describe -t plugins "${plug} plugin" $plugvar -M 'r:|.=* r:|=*' && ret=0 else (( ${(P)#plugvar} )) || set -A ${plugvar} \ - ${${(f)"$(_call_program plugins ansible-doc -t $plug -F)"}%% *} + ${${(f)"$(_call_program plugins ansible-doc -t $plug -F)"}%%(|:) *} _wanted plugins expl "${plug} plugin" compadd -M 'r:|.=* r:|=*' -a $plugvar && ret=0 fi fi