You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update clap to 3.0 and improve argument parsing and help output.
Update clap to 3.0 and improve argument parsing and help output:
- Update clap from 3.0.0-beta4 to 3.0.
- Update help output text.
- Allow easy specifying of "-1" for -O option (allow_hyphen_values(true)).
- Make -v var=value as last argument before program work
without need for "--" or other argument after.
- Make -i and -F mutually exclusive as specified field
separator as -F is not used when parsing input files
as CSV or TSV.
* Update itoa from 0.4 to 1.0.
Update itoa from 0.4 to 1.0.
itoa::Buffer::new() allocates the necessary space on the stack
automatically, and usage is similar to ryu now.
* Update other dependencies.
Update other dependencies.
* Switch to maintained version of jemallocator.
Switch to maintained version of jemallocator like rustc did in:
rust-lang/rust#83152
.help("Read the program source from the file program-file, instead of from the command line. Multiple '-f' options may be used"))
317
318
.arg(Arg::new("opt-level")
318
319
.long("opt-level")
319
320
.short('O')
320
-
.about("the optimization level for the program. Positive levels determine the optimization level for LLVM. Level -1 forces bytecode interpretation")
321
-
.possible_values(&["0","1","2","3"]))
322
-
.arg("--out-file=[FILE] 'the output file used in place of standard input'")
323
-
.arg("--utf8 'validate all input as UTF-8, returning an error if it is invalid'")
324
-
.arg("--dump-cfg 'print untyped SSA form for input program'")
325
-
.arg("--dump-bytecode 'print bytecode for input program'")
321
+
.takes_value(true)
322
+
.allow_hyphen_values(true)
323
+
.help("The optimization level for the program. Positive levels determine the optimization level for LLVM. Level `-1` forces bytecode interpretation")
324
+
.possible_values(&["-1","0","1","2","3"]))
325
+
.arg(Arg::new("out-file")
326
+
.long("out-file")
327
+
.takes_value(true)
328
+
.value_name("FILE")
329
+
.help("Write to specified output file instead of standard output"))
330
+
.arg(Arg::new("utf8")
331
+
.long("utf8")
332
+
.takes_value(false)
333
+
.help("Validate all input as UTF-8, returning an error if it is invalid"))
334
+
.arg(Arg::new("dump-cfg")
335
+
.long("dump-cfg")
336
+
.takes_value(false)
337
+
.help("Print untyped SSA form for input program"))
338
+
.arg(Arg::new("dump-bytecode")
339
+
.long("dump-bytecode")
340
+
.takes_value(false)
341
+
.help("Print bytecode for input program"))
326
342
.arg(Arg::new("parse-header")
327
343
.long("parse-header")
328
344
.short('H')
329
345
.takes_value(false)
330
-
.about("consume the first line of input and populate the `FI` variable with column names mapping to column indexes"))
346
+
.help("Consume the first line of input and populate the `FI` variable with column names mapping to column indexes"))
331
347
.arg(Arg::new("input-format")
332
348
.long("input-format")
333
349
.short('i')
334
-
.possible_values(&["csv","tsv"])
335
-
.about("Input is split according to the rules of (csv|tsv). $0 contains the unescaped line. Assigning to columns does nothing."))
350
+
.value_name("csv|tsv")
351
+
.conflicts_with("field-separator")
352
+
.help("Input is split according to the rules of (csv|tsv). $0 contains the unescaped line. Assigning to columns does nothing")
353
+
.possible_values(&["csv","tsv"]))
336
354
.arg(Arg::new("var")
337
355
.short('v')
356
+
.takes_value(true)
338
357
.multiple_occurrences(true)
339
-
.multiple_values(true)
358
+
.value_name("var=val")
359
+
.help("Assign the value <val> to the variable <var>, before execution of the frawk program begins. Multiple '-v' options may be used"))
360
+
.arg(Arg::new("field-separator")
361
+
.long("field-separator")
362
+
.short('F')
340
363
.takes_value(true)
341
-
.min_values(1)
342
-
.about("Has the form <identifier>=<chars>. A variable with the name <identifier> is assigned to an escaped string literal containing <chars> before the body of the frawk program is run."))
343
-
.arg("-F, --field-separator=[SEPARATOR] 'Field separator for frawk program.'")
364
+
.value_name("FS")
365
+
.conflicts_with("input-format")
366
+
.help("Field separator `FS` for frawk program"))
344
367
.arg(Arg::new("backend")
345
368
.long("backend")
346
369
.short('b')
347
-
.about("The backend used to run the frawk program, ranging from fastest to compile and slowest to execute, and slowest to compile and fastest to execute. Cranelift is the default")
370
+
.help("The backend used to run the frawk program, ranging from fastest to compile and slowest to execute, and slowest to compile and fastest to execute. Cranelift is the default")
348
371
.possible_values(&["interp","cranelift","llvm"]))
349
372
.arg(Arg::new("output-format")
350
373
.long("output-format")
351
374
.short('o')
352
-
.possible_values(&["csv","tsv"])
353
-
.about("If set, records output via print are escaped according to the rules of the corresponding format"))
375
+
.value_name("csv|tsv")
376
+
.help("If set, records output via print are escaped according to the rules of the corresponding format")
377
+
.possible_values(&["csv","tsv"]))
354
378
.arg(Arg::new("program")
355
-
.about("The frawk program to execute")
356
-
.index(1))
379
+
.index(1)
380
+
.help("The frawk program to execute"))
357
381
.arg(Arg::new("input-files")
358
-
.about("Input files to be read by frawk program")
359
382
.index(2)
360
-
.multiple_values(true))
383
+
.multiple_values(true)
384
+
.help("Input files to be read by frawk program"))
361
385
.arg(Arg::new("parallel-strategy")
362
-
.about("Attempt to execute the script in parallel. Strategy r[ecord] parallelizes within the current input file. Strategy f[ile] parallelizes between input files.")
363
386
.short('p')
387
+
.help("Attempt to execute the script in parallel. Strategy r[ecord] parallelizes within the current input file. Strategy f[ile] parallelizes between input files")
364
388
.possible_values(&["r","record","f","file"]))
365
389
.arg(Arg::new("chunk-size")
366
390
.long("chunk-size")
367
-
.about("Buffer size when reading input. This is present primarily for debugging purposes; it's possible that tuning this will help performance, but it should not be necessary.")
368
-
.takes_value(true))
391
+
.takes_value(true)
392
+
.help("Buffer size when reading input. This is present primarily for debugging purposes; it's possible that tuning this will help performance, but it should not be necessary"))
369
393
.arg(Arg::new("arbitrary-shell")
370
-
.about("")
371
394
.short('A')
372
395
.long("arbitrary-shell")
373
-
.about("By default, strings that are passed to the shell via pipes or the 'system' function are restricted from potentially containing user input. This flag bypasses that check, for the cases where such a use is known to be safe.")
374
-
.takes_value(false))
396
+
.takes_value(false)
397
+
.help("By default, strings that are passed to the shell via pipes or the 'system' function are restricted from potentially containing user input. This flag bypasses that check, for the cases where such a use is known to be safe"))
375
398
.arg(Arg::new("jobs")
376
-
.about("Number or worker threads to launch when executing in parallel, requires '-p' flag to be set. When using record-level parallelism, this value is an upper bound on the number of worker threads that will be spawned; the number of active worker threads is chosen dynamically.")
377
-
.short('j')
378
-
.requires("parallel-strategy")
379
-
.takes_value(true));
399
+
.short('j')
400
+
.requires("parallel-strategy")
401
+
.takes_value(true)
402
+
.help("Number or worker threads to launch when executing in parallel, requires '-p' flag to be set. When using record-level parallelism, this value is an upper bound on the number of worker threads that will be spawned; the number of active worker threads is chosen dynamically"));
380
403
cfg_if::cfg_if! {
381
404
if #[cfg(feature = "llvm_backend")]{
382
-
app = app.arg("--dump-llvm 'print LLVM-IR for the input program'");
405
+
app = app.arg("--dump-llvm 'Print LLVM-IR for the input program'");
0 commit comments