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

Re: [PATCH 3/3] t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Dec 23, 2010, 16:45 UTC
Message-ID
<_1hzkErx0quc_gF2Ej78xfngJOZd0RMiZQaYIRcFD87zYn8eAiFJUQ@cipher.nrlssc.navy.mil>
In-Reply-To
<7vlj3g326l.fsf@alter.siamese.dyndns.org>
On 12/23/2010 10:05 AM, Junio C Hamano wrote:
> This still leaves --no-bcc, --no-to and --no-cc in "no-foo overrides
> sendemail.foo" tests, it seems.  Do they also need to be fixed?

No, those are handled completely separately. The --chainreplyto option is a boolean option, and the '--no' prefix is an automatic feature that is provided by Getopt::Long for boolean options (i.e. those suffixed with '!').

The three options you mentioned are actually distinct options that are configured in the call to GetOptions and are named so that they appear to be 'no-' prefixed automatic versions of --bcc, --to, and --cc, just like the boolean options. But there is really just a separate option named --no-bcc, that sets the variable $no_bcc that is distinct from the --bcc option which populates @bcclist.

So, people with a somewhat old Getopt::Long (or those accustomed to prefixing '--no' without the dash) may get confused when they have to leave off the dash when negating --chainreplyto as --nochainreplyto, but _must_ use the dash when typing --no-bcc. If we want to be consistent with Getopt::Long which accepts both '--no-' and '--no', then we could add --nobcc, --noto, and --nocc. Not sure if it's worth the trouble.

-Brandon
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “Makefile: add NO_FNMATCH_CASEFOLD to IRIX sections”
  1. 1/3 Makefile: add NO_FNMATCH_CASEFOLD to IRIX sectionsBrandon Casey, Dec 22, 2010
  2. 2/3 test-lib.sh/test_decode_color(): use octal not hex in awk scriptBrandon Casey, Dec 22, 2010
  3. 3/3 t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'Brandon Casey, Dec 22, 2010
  4. Junio C HamanoDec 23, 2010
  5. Brandon CaseyDec 23, 2010
  6. Junio C HamanoDec 23, 2010
  7. Brandon CaseyDec 23, 2010

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.