Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Return value from execstring(), or construct Options for a builtin?
- X-seq: zsh-workers 41250
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Return value from execstring(), or construct Options for a builtin?
- Date: Wed, 7 Jun 2017 09:11:13 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=ix5Dxj8Nko2+JSCh0pjfJChuJ1fISiVkSnNM5+dBfR8=; b=CVl3YLvR7mpToJ+TPuC1QMDI9skd6SEAKjFxUB6ODmLY9oed4qH3KEdhP+8wif79JO j7TahQekj6Oz4OlGD5iTiTdZqJL8+ZkDBTO4x1OxVxPeV0wu0UFhUwnnBSXHgMBZx3H7 zI5xX6TarAFCJQfCqBFxd69MqMGDVeOmLrvH5bs6J0Seg+1n7yPPBOK3rlgGOThsWLwA MrhEpjPWh5Wmu2l/hrzC2t4JoUyjaxto9qpferCLcWOlVSB+6+t4wAuXV06keR0/bi1w n/ZaerylySJYVjxPbUR5h30D3p0CGGYpDEieMYayI6G5qUujVdbQbIcaJ/2ZyPtJsgGa DAsQ==
- In-reply-to: <etPan.5937d363.6b8b4567.2787@MacMini.local>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.5937d363.6b8b4567.2787@MacMini.local>
On Jun 7, 12:20pm, Sebastian Gniazdowski wrote:
}
} backend_cmd = "zrtie"; // (or "zgtie")
} execstring(backend_cmd, 1, 0, "ztie");
I believe this is very much the wrong way to do this (even though I
suggested it as a solution for a different specific problem).
The right thing would be to handle this the way that ZLE entry points
are managed (see Src/init.c:zleentry), with one module to contain ztie
and related functions which makes an entry point call back to the chosen
backend module.
The decisions about how to abstract bin_ztie et al. from gdbm should be
made by discussion with this group, not by you racing ahead on your own.
Proposed approaches are of course welcome (see for example the discussion
about numeric sorting).
} The problem is execstring() is void return type. Does it store retval
} somewhere?
It's in the global variable "lastval".
} I can also call builtin, have builtintab correctly searched, proper
} HashNode is obtained. But not sure how to fill Options argument.
This is handled by Src/builtin.c:execbuiltin, Options objects are
allocated by the static function new_optarg. But you should not be
in the position of needing to care about this, you should never be
calling bin_* functions directly.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author