summaryrefslogtreecommitdiffstats
path: root/js/src/shell/jsoptparse.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /js/src/shell/jsoptparse.h
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-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.h15
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. */