Message ID | b9085f1a9812a436d37bc6f8d96d17bdba4433c5.1670966008.git.nabijaczleweli@nabijaczleweli.xyz (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Herbert Xu |
Headers | show |
Series | [1/2] exec: type: ignore first --, per POSIX | expand |
наб <nabijaczleweli@nabijaczleweli.xyz> wrote: > [-- text/plain, encoding quoted-printable, charset: utf-8, 41 lines --] > > Issue 7, XCU, type, OPTIONS reads "None.", type is marked XSI. dash does claim conformance with respect to XSI. Thanks,
On Mon, Jan 02, 2023 at 05:19:17PM +0800, Herbert Xu wrote: > наб <nabijaczleweli@nabijaczleweli.xyz> wrote: > > Issue 7, XCU, type, OPTIONS reads "None.", > type is marked XSI. dash does claim conformance with respect > to XSI. Which means it ought to abide by "None." in the OPTIONS sexion, as out-lined in the subsequent lines, i.e. discard an initial --, yes. Good to see we agree, I guess? наб
On 02/01/2023 12:46, наб wrote: > On Mon, Jan 02, 2023 at 05:19:17PM +0800, Herbert Xu wrote: >> наб <nabijaczleweli@nabijaczleweli.xyz> wrote: >>> Issue 7, XCU, type, OPTIONS reads "None.", >> type is marked XSI. dash does claim conformance with respect >> to XSI. > Which means it ought to abide by "None." in the OPTIONS sexion, > as out-lined in the subsequent lines, i.e. discard an initial --, yes. > > Good to see we agree, I guess? I'm pretty sure that was a pretty bad typo and meant to say "dash does *not* claim conformance with respect to XSI." See e.g. <https://lore.kernel.org/dash/20130904032000.GA19583@gondor.apana.org.au/>, "In any case, dash does not claim XSI conformance, [...]" Cheers, Harald van Dijk
On Mon, Jan 02, 2023 at 01:46:28PM +0100, наб wrote: > On Mon, Jan 02, 2023 at 05:19:17PM +0800, Herbert Xu wrote: > > наб <nabijaczleweli@nabijaczleweli.xyz> wrote: > > > Issue 7, XCU, type, OPTIONS reads "None.", > > type is marked XSI. dash does claim conformance with respect > > to XSI. > Which means it ought to abide by "None." in the OPTIONS sexion, > as out-lined in the subsequent lines, i.e. discard an initial --, yes. > > Good to see we agree, I guess? Sorry, I meant that dash does not claim conformance. Cheers,
Hi! On Tue, Jan 03, 2023 at 09:39:17AM +0800, Herbert Xu wrote: > On Mon, Jan 02, 2023 at 01:46:28PM +0100, наб wrote: > > On Mon, Jan 02, 2023 at 05:19:17PM +0800, Herbert Xu wrote: > > > наб <nabijaczleweli@nabijaczleweli.xyz> wrote: > > > > Issue 7, XCU, type, OPTIONS reads "None.", > > > type is marked XSI. dash does claim conformance with respect > > > to XSI. > > Which means it ought to abide by "None." in the OPTIONS sexion, > > as out-lined in the subsequent lines, i.e. discard an initial --, yes. > > Good to see we agree, I guess? > Sorry, I meant that dash does not claim conformance. If I can't convince you to apply this with the consistency argument of "all built-ins that could, would parse their arguments with nextopt()", then do consider the 2/2 that does the same for getopts, which isn't shaded XSI and therefore must support this. Best, наб
On Tue, Jan 03, 2023 at 01:40:52PM +0100, наб wrote: > > If I can't convince you to apply this with the consistency argument of If you can rephrase the patch description to not refer to POSIX then I'm happy with your patch for type(1). Thanks,
diff --git a/src/exec.c b/src/exec.c index 87354d4..d61881d 100644 --- a/src/exec.c +++ b/src/exec.c @@ -760,11 +760,11 @@ unsetfunc(const char *name) int typecmd(int argc, char **argv) { - int i; int err = 0; - for (i = 1; i < argc; i++) { - err |= describe_command(out1, argv[i], NULL, 1); + nextopt(nullstr); + while (*argptr) { + err |= describe_command(out1, *argptr++, NULL, 1); } return err; }