From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27020 invoked by alias); 1 Jun 2017 05:43:38 -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: X-Seq: 22720 Received: (qmail 8130 invoked from network); 1 Jun 2017 05:43:38 -0000 X-Qmail-Scanner-Diagnostics: from mx0a-001b2d01.pphosted.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(148.163.156.1):SA:0(-3.5/5.0):. Processed in 1.299682 secs); 01 Jun 2017 05:43:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: hanpt@linux.vnet.ibm.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at linux.vnet.ibm.com does not designate permitted sender hosts) Date: Thu, 1 Jun 2017 13:43:20 +0800 From: Han Pingtian To: zsh-users@zsh.org Subject: Re: How to complete alias after alias of sudo? Mail-Followup-To: zsh-users@zsh.org References: <20170531064655.GA8512@localhost.localdomain> <20170531094310.59bb7110@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170531094310.59bb7110@pwslap01u.europe.root.pri> User-Agent: Mutt/1.8.0 (2017-02-23) X-TM-AS-GCONF: 00 x-cbid: 17060105-0020-0000-0000-00000C10664E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007152; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00868535; UDB=6.00431639; IPR=6.00648410; BA=6.00005389; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015662; XFM=3.00000015; UTC=2017-06-01 05:43:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060105-0021-0000-0000-00005C95D2AB Message-Id: <20170601054320.GA3602@localhost.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-01_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706010106 On Wed, May 31, 2017 at 09:43:10AM +0100, Peter Stephenson wrote: > On Wed, 31 May 2017 14:46:55 +0800 > Han Pingtian wrote: > > But looks like I cannot complete the second alias by : > > > > % sd f > > external command > > fold foomatic-kitload > > ... > > > > only external commands listed. > > This is down to how completion for "sd" is defined. As far as I can see > that's not a standard completion --- I would guess it's simply adding > external commands rather than all commands in that context. (I've > confirmed that _precommand, which is the nearest standard completion > that I can think of, does complete aliases in the corresponding case.) > > pws Looks like if change the line 52 of _sudo from 52 '(-)1:command: _command_names -e' to 52 '(-)1:command: _command_names' then alias will be listed. But looks like it's not a good idea to complete alias after sudo? I'll try to remember all those aliases and type them directly. Thanks.