From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13499 invoked by alias); 4 Feb 2013 04:26:18 -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: X-Seq: 31017 Received: (qmail 23322 invoked from network); 4 Feb 2013 04:26:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=PdjW0uaI1fz3uO/A6a+IkGGTOD4FWRAt3/csRU3H2Tk=; b=Fi9d7E8u9o4kC5aUfkQdJXw9MZJeXfpng8menmMv7sUYOGvBaUzp0Rd+OBD51IjASaBV0M3hJEmB4heA0W0Qd/TUR+PsnS8DCLsl4bPy0aE62PsT/ZHgb28ojjqMxd5MsVXnCt2XBlIhbZ6c4pmNf7cGxIclA8kaz3yJ85w4baA=; Date: Sun, 3 Feb 2013 23:26:09 -0500 From: Phil Pennock To: zsh-workers@zsh.org Subject: Re: Update _twisted completion Message-ID: <20130204042609.GA1571@redoubt.spodhuis.org> Mail-Followup-To: zsh-workers@zsh.org References: <20130203175328.GL2279@ragnarok.teratorn.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130203175328.GL2279@ragnarok.teratorn.org> On 2013-02-03 at 12:53 -0500, Eric P. Mangold wrote: > Twisted ships a large number of commands, and e.g. `twistd' sub-commands are dynamically generated at runtime via plugin loading. As such, a static completion function is innappropriate for Twisted, and would be instantly out of date. So, the stub function just asks Twisted to send it a > completion function on stdout, which if well formed can be eval'd inside the stub function (_twisted) to produce results. Wait what, a function to be eval'd, so can do anything in the shell environment, which runs because I press tab when seeing what options this "command the user is not familiar with" might offer? Is there no way to rationalize the options for expansion down to a schema with "global options, sub-commands, sub-command options, tags for known contexts" and have the _twisted function interpret those accordingly? There's a difference between running an unknown command and having your shell execute, in its own context, any evaluable code supplied by that command because the user hit _tab_, not _enter_. -Phil