From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31132 invoked from network); 30 Oct 2021 22:09:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Oct 2021 22:09:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1635631741; b=YXYRAvO0s2u66LpN8lNkUn41Og/W2WGoHwy1K1oQVxvvevvvH405IS83v6aubGgw966viFgJh4 6tjcCs2pmgTCoDu4QCr6gUDhBNmsi7tHi886DHP86dR+DkMzlb7drXkJn6JFWUl1LZQWT6GNKC BedhtIgNM37ilBoPZT7pTXhlc1VtR+mZMalCZ/rFcZ9S1yaHsb3hEPmdHTXLDuiRH1TCCW8N5o AKRsEFzau3/NgXyPqJpltlsBIPoehbNXk2ZUS+XaZj95sKmBIwlqUd1ftjxKjXV0MkoOnqg7zC N3naINKfPlUPbsjMvpJcwK4NoLa1BqP69x3tPyrWVMLQNw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (pv50p00im-zteg10021301.me.com) smtp.remote-ip=17.58.6.46; dkim=pass header.d=me.com header.s=1a1hai header.a=rsa-sha256; dmarc=pass header.from=me.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1635631741; bh=rRF1tX/pHgFBF/XJXYG2p8IzvJx23UqXXqBK6IjHe0M=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:Message-ID:Subject:Date:MIME-Version:From: Content-Transfer-Encoding:Content-Type:DKIM-Signature:DKIM-Signature; b=GnwgpS1sHa3ul7/yp8RtoSxCIWuDryAPlzJ9T+D54s5Aw4uYWDe1SOI3D23m2fy4pdq17nWrRP E3kxaDC1d7lulNj5iixWwlIjiIBjmFjnmtglIFGmIoRsPFOOQAdITvSOtpdNbQbVg5P0piuoQU Rvt5NMBphtyv/Vkk0LGEDZvs9KbxAr8rzyzMqqZ2Dno/ndYD3rOY2lsKYTqO5QWq/PKPh396Ii zJNhOl8qk/o5D/8Tti7njrgXVsGTnTGe124kp3185SDZQaTt+4xK+OhpMGTCk9/tjUivYsoQB3 l2wrKh9AT/HrhnTmU9VQ5fTjX8JnnZBh/xMecA0sqC4UNA==; 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:To:Message-Id:Subject:Date: Mime-Version:From:Content-Transfer-Encoding:Content-Type:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=qkAMH5xjD8VzCVupIxc+eVA24ZMfqVsuvJsGwt6Dcg8=; b=osatZYmE1jhR9DP+kXGLZ79UU+ g+zbbECQv0Cdzhxr+2RI+c63bNFh3SO/3n2I7nXcbGlq1D/40KIdOuAuRQUxlitp+3ptXWssWDfbI DXKnptHgmevYyxaWSOAsrfSNl5hgbUMUOSqL2cuAWREp2jW2xSfUCOdazYLFiPE5vYMNp4YSl/Vee TqUo3WWd4bnbWDJ9YMZdiM+yefA8yGrSwKHXwn/diLSzfSngVbfRG/QO22i4EckPaogGYVdaDUOBh eHVvp42Di8GxCs+wIK5Rl0KRFYey2C8USXhSmqogJ66grOOLsWAgmgsnMHOyL5EvMdAEtKDxeFK3x WnwgLVtg==; Received: from authenticated user by zero.zsh.org with local id 1mgwX5-000G2K-Pq; Sat, 30 Oct 2021 22:08:59 +0000 Authentication-Results: zsh.org; iprev=pass (pv50p00im-zteg10021301.me.com) smtp.remote-ip=17.58.6.46; dkim=pass header.d=me.com header.s=1a1hai header.a=rsa-sha256; dmarc=pass header.from=me.com; arc=none Received: from pv50p00im-zteg10021301.me.com ([17.58.6.46]:54149) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mgwW0-000FLC-Ud; Sat, 30 Oct 2021 22:07:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1635631671; bh=qkAMH5xjD8VzCVupIxc+eVA24ZMfqVsuvJsGwt6Dcg8=; h=Content-Type:From:Mime-Version:Date:Subject:Message-Id:To; b=nR912ds/JNWAHcyWLFNaGpv+M/ArxTYK9qRRZFiEEhPsLH26FUdbm1UuC6AqOmK0H TfUZN+CeXuucv3bYFJrp2mratvLrvvRpbkn4ivWy+BX9mftiU8/dzKqlUWWT91KY3v pmsGsz6NqyXmzLAIUeVJxFP2bS2OAng1k5YelYdMXlJpu+PM3fH879bs7fuPQ4Z5S3 7ipJDOGqCG6dB5cvvZexM+mGm/8ynAltyWHsNPXn4Ov/5OZQAvpNkreoqK0l8H3TsG 1m4w4de7TwP4fbwekfzLbFF3ZKbHqrRx6vGre1Ra5TA9zOqec1Vx87MAr1CIl7mrDr UP83HNKGYCOkQ== Received: from smtpclient.apple (92-247-251-232.spectrumnet.bg [92.247.251.232]) by pv50p00im-zteg10021301.me.com (Postfix) with ESMTPSA id 46314CC0457 for ; Sat, 30 Oct 2021 22:07:50 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Anton Suslov Mime-Version: 1.0 (1.0) Date: Sun, 31 Oct 2021 01:07:47 +0300 Subject: Composing completions for a wrapper script Message-Id: To: zsh-users@zsh.org X-Mailer: iPad Mail (18H17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425,18.0.790 definitions=2021-10-30_05:2021-10-29,2021-10-30 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=981 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2110300131 X-Seq: 27299 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Hi, everyone! I am writing some wrapper functions over existing commands, e.g. kubectldc() { DC=3D"$1" shift KUBECONFIG=3D"$HOME/.kube/$DC.kubeconfig" kubectl "$@" } Kubectl is a well-behaved command, which does have rich completion available= . Is it possible to somehow reuse its completion for kubectldc command? As-i= s the function definition becomes a tradeoff between "using kubectl directly= for completion but having to select config manually" and "using the wrapper= for automatic config but no completion".=