diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /js/src/shell/jsoptparse.h | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/shell/jsoptparse.h')
-rw-r--r-- | js/src/shell/jsoptparse.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/js/src/shell/jsoptparse.h b/js/src/shell/jsoptparse.h index 17e4878969..34f46fed48 100644 --- a/js/src/shell/jsoptparse.h +++ b/js/src/shell/jsoptparse.h @@ -69,21 +69,23 @@ struct Option { const char* help; OptionKind kind; char shortflag; - bool terminatesOptions; + bool terminatesOptions = false; + bool ignoresUnknownOptions = false; Option(OptionKind kind, char shortflag, const char* longflag, const char* help) - : longflag(longflag), - help(help), - kind(kind), - shortflag(shortflag), - terminatesOptions(false) {} + : longflag(longflag), help(help), kind(kind), shortflag(shortflag) {} virtual ~Option() = 0; void setTerminatesOptions(bool enabled) { terminatesOptions = enabled; } bool getTerminatesOptions() const { return terminatesOptions; } + void setIgnoresUnknownOptions(bool enabled) { + ignoresUnknownOptions = enabled; + } + bool getIgnoresUnknownOptions() const { return ignoresUnknownOptions; } + virtual bool isValued() const { return false; } /* Only some valued options are variadic (like MultiStringOptions). */ @@ -293,6 +295,7 @@ class OptionParser { void setDescription(const char* description) { descr = description; } void setHelpOption(char shortflag, const char* longflag, const char* help); void setArgTerminatesOptions(const char* name, bool enabled); + void setIgnoresUnknownOptions(const char* name, bool enabled); void setArgCapturesRest(const char* name); /* Arguments: no further arguments may be added after a variadic argument. */ |