Re: [PATCH] parse-options: Allow abbreviated options when unambiguous
Hi,
On Sun, 14 Oct 2007, Johannes Schindelin wrote:
> When there is an option "--amend", the option parser now recognizes
> "--am" for that option, provided that there is no other option beginning
> with "--am".
And an amend for ultra-abbreviated options (as you noticed on IRC):
diff --git a/parse-options.c b/parse-options.c
index afc6c89..acabb98 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -137,6 +137,11 @@ is_abbreviated:
abbrev_flags = flags;
continue;
}
+ /* negated and abbreviated very much? */
+ if (!prefixcmp("no-", arg)) {
+ flags |= OPT_UNSET;
+ goto is_abbreviated;
+ }
/* negated? */
if (strncmp(arg, "no-", 3))
continue;