From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Additional arguments to "emulate -c"
Date: Sat, 15 Apr 2017 21:09:34 -0700 [thread overview]
Message-ID: <170415210934.ZM24985@torch.brasslantern.com> (raw)
As presently implemented,
emulate zsh -c first rest
will produce the error "emulate: unknown argument rest".
The intention here was that the -c option would behave akin to -c in the
options at shell startup that is in
zsh -c first rest
only "first" is interpreted as a command, and "rest" (etc.) becomes $@
for the top-level shell.
However, there doesn't seem to be any other reason for "emulate -c" to
behave as it currently does. So the question is, should "emulate -c":
1. Stay exactly as it is, i.e., error on extra arguments?
2. Assign arguments to $@, ala "set -- rest", before eval'ing "first"?
3. Pass all of the non-option arguments following -c, to "eval"?
Of these, 2 is the most complicated to implement, and raises the added
question of whether $@ should be set only for the duration of the eval,
somewhat as if "emulate" was itself a shell function, or should instead
persist as the emulation mode itself does.
In the absence of feedback, #1 wins.
reply other threads:[~2017-04-16 4:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=170415210934.ZM24985@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).