From 7cfd4a9c8525096fd43e6a33a55b8b175e4e1fdb Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Wed, 22 May 2024 20:59:47 -0400 Subject: Make the = between options and values optional Documentation upcoming with wider improvements to the manual, hopefully. --- config.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/config.c b/config.c index be88f2f..e568e40 100644 --- a/config.c +++ b/config.c @@ -97,13 +97,6 @@ int getopt_config( } char *equal = &name[len] + strspn(&name[len], WS); - if (*equal && *equal != '=') { - warnx( - "%s:%zu: option `%s' missing equals sign", - path, num, option->name - ); - return clean('?'); - } if (option->has_arg == no_argument && *equal) { warnx( "%s:%zu: option `%s' doesn't allow an argument", @@ -121,8 +114,11 @@ int getopt_config( optarg = NULL; if (*equal) { - char *arg = &equal[1] + strspn(&equal[1], WS); - optarg = strdup(arg); + if (*equal == '=') { + optarg = strdup(&equal[1] + strspn(&equal[1], WS)); + } else { + optarg = strdup(equal); + } if (!optarg) { warn("getopt_config"); return clean('?'); -- cgit 1.4.1 e'>tree commit diff
path: root/etc/psf/Makefile (unfollow)
Commit message (Expand)Author
2021-02-04Use owner-filter to add Liberapay donation buttonsJune McEnroe
2021-02-04Use owner-filter for repo page headersJune McEnroe
2021-02-04Warn twice about stopped jobsJune McEnroe
2021-02-04Remove cgit logo using cgitrcJune McEnroe
2021-01-31Add The Rosewater RedemptionJune McEnroe
2021-01-29Use int when checking for EOFJune McEnroe
2021-01-28Move gpl.c and agpl.c templates out of etcJune McEnroe
2021-01-27Set para and sect for mdocJune McEnroe
2021-01-26Use First state to match keyword at beginning of lineJune McEnroe
2021-01-25Install vi on Linux and nvi on macOSJune McEnroe
2021-01-25Use vi and lessJune McEnroe
2021-01-20Use mtags for sh in source-filterJune McEnroe
2021-01-20Generate tags for sh files in mtagsJune McEnroe
2021-01-20Add messy sh lexerJune McEnroe
2021-01-20Add all target to git.causal.agency MakefileJune McEnroe
2021-01-20Remove Lua supportJune McEnroe
2021-01-20Fix tests for diff spansJune McEnroe
2021-01-20Avoid matching ':' in make tagsJune McEnroe
2021-01-19Prefer tag matches not preceded by [[:alnum:]]June McEnroe
2021-01-19Escape \ and / in mtags search patternsJune McEnroe
2021-01-20Use mtags in source-filterJune McEnroe
2021-01-19Add mtags to generate tags for make and mdocJune McEnroe
2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe
2021-01-19Don't use a pager if reading standard inputJune McEnroe
2021-01-19Support BSD make syntax and match *.amJune McEnroe
2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe
2021-01-18Allow matching lexers using first input lineJune McEnroe