Skip to content

Commit e4fa32c

Browse files
committed
updating command line
1 parent 98c86c1 commit e4fa32c

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ Libs already included:
122122
# running
123123
~/Ark$ Ark --help
124124
SYNOPSIS
125-
build/Ark -h
125+
build/Ark -h, --help
126126
build/Ark --version
127127
build/Ark --dev-info
128-
build/Ark -r
129-
build/Ark <file> [-d|-bcr] [-L <lib_dir>] [-ffunction-arity-check|-fno-function-arity-check]
128+
build/Ark (<file>|-r, --repl) [-(d|bcr)] [-L, --lib <lib_dir>] [-f(function-arity-check|no-function-arity-check)] [-f(allow-invalid-token-after-paren|no-invalid-token-after-paren)]
130129

131130
OPTIONS
132131
-h, --help Display this message
@@ -137,9 +136,12 @@ OPTIONS
137136
-bcr, --bytecode-reader Launch the bytecode reader
138137
-L, --lib Define the directory where the Ark standard library is
139138

140-
-ffunction-arity-check|-fno-function-arity-check
139+
-f(function-arity-check|no-function-arity-check)
141140
Toggle function arity checks (default: ON)
142141

142+
-f(allow-invalid-token-after-paren|no-invalid-token-after-paren)
143+
Authorize invalid token after `(' (default: OFF). When ON, only display a warning
144+
143145
LICENSE
144146
Mozilla Public License 2.0
145147
```

src/main.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ int main(int argc, char** argv)
4545
| option("-bcr", "--bytecode-reader").set(selected, mode::bytecode_reader).doc("Launch the bytecode reader")
4646
),
4747
(
48-
option("-L", "--lib").doc("Define the directory where the Ark standard library is")
48+
option("-L", "--lib").doc("Set the location of the ArkScript standard library")
4949
& value("lib_dir", lib_dir)
5050
),
51-
(
52-
( option("-ffunction-arity-check").call([&]{ options |= Ark::FeatureFunctionArityCheck; })
53-
| option("-fno-function-arity-check").call([&]{ options &= ~Ark::FeatureFunctionArityCheck; })
51+
with_prefix("-f",
52+
( option("function-arity-check" ).call([&]{ options |= Ark::FeatureFunctionArityCheck; })
53+
| option("no-function-arity-check").call([&]{ options &= ~Ark::FeatureFunctionArityCheck; })
5454
).doc("Toggle function arity checks (default: ON)")
55-
, ( option("-fallow-invalid-token-after-paren").call([&]{ options &= ~Ark::FeatureDisallowInvalidTokenAfterParen; })
56-
| option("-fno-invalid-token-after-paren").call([&]{ options |= Ark::FeatureDisallowInvalidTokenAfterParen; })
55+
,
56+
( option("allow-invalid-token-after-paren").call([&]{ options &= ~Ark::FeatureDisallowInvalidTokenAfterParen; })
57+
| option("no-invalid-token-after-paren" ).call([&]{ options |= Ark::FeatureDisallowInvalidTokenAfterParen; })
5758
).doc("Authorize invalid token after `(' (default: OFF). When ON, only display a warning")
5859
)
5960
)
@@ -66,6 +67,7 @@ int main(int argc, char** argv)
6667
.doc_column(36) // parameter docstring start col
6768
.indent_size(2) // indent of documentation lines for children of a documented group
6869
.split_alternatives(true) // split usage into several lines for large alternatives
70+
.merge_alternative_flags_with_common_prefix(true) // [-fok] [-fno-ok] becomes [-f(ok|no-ok)]
6971
;
7072

7173
if (parse(argc, argv, cli) && wrong.empty())

0 commit comments

Comments
 (0)