summaryrefslogtreecommitdiffstats
path: root/js/src/shell/jsoptparse.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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. */