git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] test-lib: allow short options to be stacked

From
Jeff King <peff@peff.net>
Date
Mar 22, 2020, 06:49 UTC
Message-ID
<20200322064940.GA599744@coredump.intra.peff.net>
In-Reply-To
<CAHd-oW4cGEwyge+BPRGiOsmMxr5ne9Ufk-BOM4EgG_i6qTxxMg@mail.gmail.com>
On Sat, Mar 21, 2020 at 03:50:55PM -0300, Matheus Tavares Bernardino wrote:
Show 12 quoted lines
> > which seems reasonable. But:
> >
> >   ./t1234-foo.sh -rr 5 6
> >
> > would get garbled.
> 
> ... we could prohibit using more than one "short option with
> arguments" in the same bundle. This would not only solve the problem
> for "-rr 5 6"[1] but also for the scenario of future new options. And
> it's quite simple to implement, we just have to check whether
> $store_arg_to is set before setting it to another value. I'll try that
> for v2.

Yeah, I'd be perfectly happy with that. This bundling is a new format that did not exist before, so we are not taking away anything you could previously do. As long as we don't produce a wrong or confusing result (and instead say "don't do that; we don't support it", anybody else is free to come along later and make it work. :)

> [1]: Someone that used '-rr 5 6' might have wanted the script to run
> *both* tests 5 and 6. But I don't think we need to support that now,
> since '-r 5 -r 6' doesn't do that as well (instead, the last value
> overrides all previous ones).

Heh, that's what I assumed "-r 5 -r 6" would do, but I guess it goes to show that I do not use that option very much. :)

-Peff
Previous: Matheus Tavares BernardinoNext: SZEDER Gábor
Message 6 of 16 in “test-lib: allow short options to be stacked”
  1. test-lib: allow short options to be stackedMatheus Tavares, Mar 21, 2020
  2. Junio C HamanoMar 21, 2020
  3. Matheus TavaresMar 21, 2020
  4. Jeff KingMar 21, 2020
  5. Matheus Tavares BernardinoMar 21, 2020
  6. Jeff KingMar 22, 2020
  7. SZEDER GáborMar 22, 2020
  8. Junio C HamanoMar 21, 2020
  9. Johannes SixtMar 21, 2020
  10. Matheus Tavares BernardinoMar 21, 2020
  11. Junio C HamanoMar 21, 2020
  12. test-lib: allow short options to be bundledMatheus Tavares, Mar 21, 2020
  13. Junio C HamanoMar 21, 2020
  14. Matheus Tavares BernardinoMar 21, 2020
  15. test-lib: allow short options to be bundledMatheus Tavares, Mar 22, 2020
  16. Junio C HamanoMar 23, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.