On Sun, 01 Oct 2017, Tomi Ollila wrote:
> On Sun, Oct 01 2017, Jani Nikula wrote:
>
>> Several changes at once, just to not have to change the same lines
>> several times over:
>>
>> - Use designated initializers to initialize opt desc arrays.
>>
>> - Only initialize the
On Sun, 01 Oct 2017, David Bremner wrote:
> Jani Nikula writes:
>> id:20170930213239.15392-1-j...@nikula.org would make it easier to add,
>> say, a notmuch_bool_t *present field to notmuch_opt_desc_t that we could
>> set whenever we see the option and we want
Mark Walters writes:
> Incidentally, I think "/" is an alternative for the fcc line which
> already works, which is "\"/\" in notmuch-fcc-dirs.
Perhaps, notmuch should be made to tolerate a "/" at the beginning of the
Fcc folder argument. That is, notmuch should not
Several subtle interconnected changes here:
- If the folder name passed as argument is the empty string "" or
slash "/", the final maildir path would end up having "//" in it. We
should strip the final maildir path, not folder.
- The folder variable should really be const char *, another
Several changes at once, just to not have to change the same lines
several times over:
- Use designated initializers to initialize opt desc arrays.
- Only initialize the needed fields.
- Remove arg_id (short options) as unused.
- Replace opt_type and output_var with several type safe output
Pedantically correct, although they're the same underlying type.
---
test/hex-xcode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/hex-xcode.c b/test/hex-xcode.c
index bc2df713b2a3..221ccdb90843 100644
--- a/test/hex-xcode.c
+++ b/test/hex-xcode.c
@@ -45,7 +45,7 @@
Add pointer to boolean .present field to opt desc, which (if non-NULL)
will be set to TRUE if the argument in question is present on the
command line. Unchanged otherwise.
---
command-line-arguments.c | 11 ---
command-line-arguments.h | 3 +++
2 files changed, 11 insertions(+), 3
Surprisingly it's not there.
---
test/T410-argument-parsing.sh | 3 ++-
test/arg-test.c | 5 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/T410-argument-parsing.sh b/test/T410-argument-parsing.sh
index fad134e305c5..4505c58301ea 100755
---
This series combines the designated initializers for argument parsing
from id:20170930213239.15392-1-j...@nikula.org and the argument parsing
refactoring from id:cover.1505853159.git.j...@nikula.org.
Additionally patch 1 handles some const confusion in notmuch-insert
before it becomes a problem
Test and use the new .present field, only output the parameters
given. Test space between parameter name and value.
---
test/T410-argument-parsing.sh | 22 ++
test/arg-test.c | 33 ++---
2 files changed, 40 insertions(+), 15
Reducing indent makes future changes easier. No functional changes.
---
command-line-arguments.c | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/command-line-arguments.c b/command-line-arguments.c
index c591dcbec7cc..3fa8d9044966 100644
---
On Sun, Oct 01 2017, Jani Nikula wrote:
> Several changes at once, just to not have to change the same lines
> several times over:
>
> - Use designated initializers to initialize opt desc arrays.
>
> - Only initialize the needed fields.
>
> - Remove arg_id (short options) as unused.
>
> - Replace
On Sun, Oct 01 2017, Jani Nikula wrote:
> On Sun, 01 Oct 2017, Tomi Ollila wrote:
>>
>> Good stuff. It just doesn't longer compile on older compilers (so some
>> note on commit message should be added):
>
> Does this on top fix it? I used the unnamed struct just for clarity,
The --entire-thread default depends on other arguments, so we'll have
to figure out if it was explicitly set by the user or not. The arg
parser .present feature helps us clean up the code here.
---
notmuch-show.c | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff
Clean up the control flow to prepare for future changes. No functional
changes.
---
command-line-arguments.c | 27 +--
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/command-line-arguments.c b/command-line-arguments.c
index 39940d5fb9fd..ee8be18942d0
Test the various boolean formats and --no- prefixed boolean and
keyword flag arguments.
---
test/T410-argument-parsing.sh | 28
1 file changed, 28 insertions(+)
diff --git a/test/T410-argument-parsing.sh b/test/T410-argument-parsing.sh
index
This lets us use the positive hooks variable in code, increasing
clarity.
---
notmuch-insert.c | 6 +++---
notmuch-new.c| 8
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/notmuch-insert.c b/notmuch-insert.c
index bbbc29ea103d..7048e8ae2d7f 100644
---
Pedantically correct, although they're the same underlying type.
---
notmuch-show.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/notmuch-show.c b/notmuch-show.c
index d0e86f412e80..3d11a40c6a59 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -1085,7 +1085,7 @@
Using a for loop makes it easier to use continue, in preparation for
future changes. No functional changes.
---
command-line-arguments.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/command-line-arguments.c b/command-line-arguments.c
index ee8be18942d0..c591dcbec7cc
Add transparent support for negating boolean and keyword flag
arguments using --no-argument style on the command line. That is, if
the option description contains a boolean or a keyword flag argument
named "argument", --no-argument will match and negate it.
For boolean arguments this obviously
Jani Nikula writes:
>>
>> One thing we eventually settled on in the query parser is that an
>> opening '/' without a trailing '/' is an errror. But perhaps it's fine
>> to take a more permissive approach here.
>
> I'm fine either way, I just chose to be permissive.
>
> So do I
Jani Nikula writes:
> Reducing indent makes future changes easier. No functional changes.
First 12 patches LGTM.
d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch
Jani Nikula writes:
> Just some basics.
> ---
> test/T050-new.sh | 22 ++
> 1 file changed, 22 insertions(+)
Tests fail after applying this patch (output attached).
It sortof looks like the regexp ignore is not working?
T50.out
Description: Binary data
Jani Nikula writes:
> @@ -171,11 +186,22 @@ parse_option (int argc, char **argv, const
> notmuch_opt_desc_t *options, int opt_
> if (! try->name)
> continue;
>
> - if (strncmp (arg, try->name, strlen (try->name)) != 0)
> + char next;
> + const char
Just split the arguments to two opt desc arrays.
---
test/arg-test.c | 17 +++--
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/test/arg-test.c b/test/arg-test.c
index 9d13618bd17c..a379f23e308a 100644
--- a/test/arg-test.c
+++ b/test/arg-test.c
@@ -14,18 +14,23 @@ int
On Sun, 01 Oct 2017, Tomi Ollila wrote:
> On Sun, Oct 01 2017, Jani Nikula wrote:
>
>> On Sun, 01 Oct 2017, Tomi Ollila wrote:
>>>
>>> Good stuff. It just doesn't longer compile on older compilers (so some
>>> note on commit message should be added):
>>
>>
Jani Nikula writes:
> Several changes at once, just to not have to change the same lines
> several times over:
the general approach here looks fine. I didn't see any blockers, but
I'll wait a few days before merging.
This probably causes some rebasing pain for other people,
Jani Nikula writes:
> On Sat, 30 Sep 2017, Jani Nikula wrote:
>> Looking at the defaults from another angle, if we don't want the ability
>> to set --foo=default explicitly, I still think passing ints as booleans
>> to the argument parser and checking if a
28 matches
Mail list logo