mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-25 08:53:55 +00:00
doc neaten, and doc of put/filter -a option
This commit is contained in:
parent
bc1bca6c46
commit
190f2ee673
6 changed files with 48 additions and 195 deletions
|
|
@ -647,8 +647,9 @@ static void resolve_func_callsite(fmgr_t* pfmgr, rval_evaluator_t* pev) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
// Struct assignment into callsite space
|
||||
*pev = *pevaluator;
|
||||
free(pevaluator); // xxx comment
|
||||
free(pevaluator);
|
||||
}
|
||||
|
||||
// ================================================================
|
||||
|
|
|
|||
|
|
@ -127,7 +127,6 @@ static void mapper_put_usage(FILE* o, char* argv0, char* verb) {
|
|||
fprintf(o, "including function list. Or \"%s -f\".\n", argv0);
|
||||
fprintf(o, "Please see in particular:\n");
|
||||
fprintf(o, " http://www.johnkerl.org/miller/doc/reference.html#put\n");
|
||||
shared_usage(o, argv0, verb);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
|
@ -162,10 +161,11 @@ static void mapper_filter_usage(FILE* o, char* argv0, char* verb) {
|
|||
|
||||
static void shared_usage(FILE* o, char* argv0, char* verb) {
|
||||
fprintf(o, "Options:\n");
|
||||
fprintf(o, "-v: First prints the AST (abstract syntax tree) for the expression, which gives\n");
|
||||
fprintf(o, " full transparency on the precedence and associativity rules of Miller's\n");
|
||||
fprintf(o, " grammar.\n");
|
||||
fprintf(o, "-t: Print low-level parser-trace to stderr.\n");
|
||||
fprintf(o, "-v: Prints the expressions's AST (abstract syntax tree), which gives\n");
|
||||
fprintf(o, " full transparency on the precedence and associativity rules of\n");
|
||||
fprintf(o, " Miller's grammar, to stdout.\n");
|
||||
fprintf(o, "-a: Prints a low-level stack-allocation trace to stdout.\n");
|
||||
fprintf(o, "-t: Prints a low-level parser trace to stderr.\n");
|
||||
if (streq(verb, "put")) {
|
||||
fprintf(o, "-q: Does not include the modified record in the output stream. Useful for when\n");
|
||||
fprintf(o, " all desired output is in begin and/or end blocks.\n");
|
||||
|
|
@ -284,7 +284,7 @@ static mapper_t* shared_parse_cli(int* pargi, int argc, char** argv,
|
|||
} else if (streq(argv[argi], "-v")) {
|
||||
print_ast = TRUE;
|
||||
argi += 1;
|
||||
} else if (streq(argv[argi], "-a")) { // xxx to on-line help
|
||||
} else if (streq(argv[argi], "-a")) {
|
||||
trace_stack_allocation = TRUE;
|
||||
argi += 1;
|
||||
} else if (streq(argv[argi], "-t")) {
|
||||
|
|
|
|||
|
|
@ -526,10 +526,11 @@ VERBS
|
|||
evaluated and the last one is used as the filter criterion.
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-x: Prints records for which {expression} evaluates to false.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
|
|
@ -814,10 +815,11 @@ VERBS
|
|||
regex-captures into \1, \2, etc.).
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
|
|
@ -880,45 +882,6 @@ VERBS
|
|||
including function list. Or "mlr -f".
|
||||
Please see in particular:
|
||||
http://www.johnkerl.org/miller/doc/reference.html#put
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
-F: Keeps field values, or literals in the expression, as strings or floats
|
||||
with no inference to int.
|
||||
--oflatsep {string}: Separator to use when flattening multi-level @-variables
|
||||
to output records for emit. Default ":".
|
||||
-f {filename}: the DSL expression is taken from the specified file rather
|
||||
than from the command line. Outer single quotes wrapping the expression
|
||||
should not be placed in the file. If -f is specified more than once,
|
||||
all input files specified using -f are concatenated to produce the expression.
|
||||
(For example, you can define functions in one file and call them from another.)
|
||||
-e {expression}: You can use this after -f to add an expression. Example use
|
||||
case: define functions/subroutines in a file you specify with -f, then call
|
||||
them with an expression you specify with -e.
|
||||
(If you mix -e and -f then the expressions are evaluated in the order encountered.
|
||||
Since the expression pieces are simply concatenated, please be sure to use intervening
|
||||
semicolons to separate expressions.)
|
||||
--no-fflush: for emit, tee, print, and dump, don't call fflush() after every
|
||||
record.
|
||||
Any of the output-format command-line flags (see mlr -h). Example: using
|
||||
mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ...
|
||||
the input is CSV, the output is pretty-print tabular, but the tee-file output
|
||||
is written in JSON format.
|
||||
|
||||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables. The environment-variable name may be an expression, e.g. a field
|
||||
value.
|
||||
|
||||
Use # to comment to end of line.
|
||||
|
||||
regularize
|
||||
Usage: mlr regularize
|
||||
|
|
|
|||
|
|
@ -379,10 +379,11 @@ VERBS
|
|||
evaluated and the last one is used as the filter criterion.
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-x: Prints records for which {expression} evaluates to false.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
|
|
@ -667,10 +668,11 @@ VERBS
|
|||
regex-captures into \1, \2, etc.).
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
|
|
@ -733,45 +735,6 @@ VERBS
|
|||
including function list. Or "mlr -f".
|
||||
Please see in particular:
|
||||
http://www.johnkerl.org/miller/doc/reference.html#put
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
-F: Keeps field values, or literals in the expression, as strings or floats
|
||||
with no inference to int.
|
||||
--oflatsep {string}: Separator to use when flattening multi-level @-variables
|
||||
to output records for emit. Default ":".
|
||||
-f {filename}: the DSL expression is taken from the specified file rather
|
||||
than from the command line. Outer single quotes wrapping the expression
|
||||
should not be placed in the file. If -f is specified more than once,
|
||||
all input files specified using -f are concatenated to produce the expression.
|
||||
(For example, you can define functions in one file and call them from another.)
|
||||
-e {expression}: You can use this after -f to add an expression. Example use
|
||||
case: define functions/subroutines in a file you specify with -f, then call
|
||||
them with an expression you specify with -e.
|
||||
(If you mix -e and -f then the expressions are evaluated in the order encountered.
|
||||
Since the expression pieces are simply concatenated, please be sure to use intervening
|
||||
semicolons to separate expressions.)
|
||||
--no-fflush: for emit, tee, print, and dump, don't call fflush() after every
|
||||
record.
|
||||
Any of the output-format command-line flags (see mlr -h). Example: using
|
||||
mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ...
|
||||
the input is CSV, the output is pretty-print tabular, but the tee-file output
|
||||
is written in JSON format.
|
||||
|
||||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables. The environment-variable name may be an expression, e.g. a field
|
||||
value.
|
||||
|
||||
Use # to comment to end of line.
|
||||
|
||||
regularize
|
||||
Usage: mlr regularize
|
||||
|
|
|
|||
57
doc/mlr.1
57
doc/mlr.1
|
|
@ -526,10 +526,11 @@ If there are multiple semicolon-delimited expressions, all of them are
|
|||
evaluated and the last one is used as the filter criterion.
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-x: Prints records for which {expression} evaluates to false.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
|
|
@ -898,10 +899,11 @@ booleans without following curly braces do nothing except side effects (e.g.
|
|||
regex-captures into \e1, \e2, etc.).
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
|
|
@ -964,45 +966,6 @@ Please see http://johnkerl.org/miller/doc/reference.html for more information
|
|||
including function list. Or "mlr -f".
|
||||
Please see in particular:
|
||||
http://www.johnkerl.org/miller/doc/reference.html#put
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
-F: Keeps field values, or literals in the expression, as strings or floats
|
||||
with no inference to int.
|
||||
--oflatsep {string}: Separator to use when flattening multi-level @-variables
|
||||
to output records for emit. Default ":".
|
||||
-f {filename}: the DSL expression is taken from the specified file rather
|
||||
than from the command line. Outer single quotes wrapping the expression
|
||||
should not be placed in the file. If -f is specified more than once,
|
||||
all input files specified using -f are concatenated to produce the expression.
|
||||
(For example, you can define functions in one file and call them from another.)
|
||||
-e {expression}: You can use this after -f to add an expression. Example use
|
||||
case: define functions/subroutines in a file you specify with -f, then call
|
||||
them with an expression you specify with -e.
|
||||
(If you mix -e and -f then the expressions are evaluated in the order encountered.
|
||||
Since the expression pieces are simply concatenated, please be sure to use intervening
|
||||
semicolons to separate expressions.)
|
||||
--no-fflush: for emit, tee, print, and dump, don't call fflush() after every
|
||||
record.
|
||||
Any of the output-format command-line flags (see mlr -h). Example: using
|
||||
mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ...
|
||||
the input is CSV, the output is pretty-print tabular, but the tee-file output
|
||||
is written in JSON format.
|
||||
|
||||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables. The environment-variable name may be an expression, e.g. a field
|
||||
value.
|
||||
|
||||
Use # to comment to end of line.
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
|
|
|
|||
|
|
@ -1248,10 +1248,11 @@ If there are multiple semicolon-delimited expressions, all of them are
|
|||
evaluated and the last one is used as the filter criterion.
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-x: Prints records for which {expression} evaluates to false.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
|
|
@ -2219,10 +2220,11 @@ booleans without following curly braces do nothing except side effects (e.g.
|
|||
regex-captures into \1, \2, etc.).
|
||||
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-v: Prints the expressions's AST (abstract syntax tree), which gives
|
||||
full transparency on the precedence and associativity rules of
|
||||
Miller's grammar, to stdout.
|
||||
-a: Prints a low-level stack-allocation trace to stdout.
|
||||
-t: Prints a low-level parser trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
|
|
@ -2285,45 +2287,6 @@ Please see http://johnkerl.org/miller/doc/reference.html for more information
|
|||
including function list. Or "mlr -f".
|
||||
Please see in particular:
|
||||
http://www.johnkerl.org/miller/doc/reference.html#put
|
||||
Options:
|
||||
-v: First prints the AST (abstract syntax tree) for the expression, which gives
|
||||
full transparency on the precedence and associativity rules of Miller's
|
||||
grammar.
|
||||
-t: Print low-level parser-trace to stderr.
|
||||
-q: Does not include the modified record in the output stream. Useful for when
|
||||
all desired output is in begin and/or end blocks.
|
||||
-S: Keeps field values, or literals in the expression, as strings with no type
|
||||
inference to int or float.
|
||||
-F: Keeps field values, or literals in the expression, as strings or floats
|
||||
with no inference to int.
|
||||
--oflatsep {string}: Separator to use when flattening multi-level @-variables
|
||||
to output records for emit. Default ":".
|
||||
-f {filename}: the DSL expression is taken from the specified file rather
|
||||
than from the command line. Outer single quotes wrapping the expression
|
||||
should not be placed in the file. If -f is specified more than once,
|
||||
all input files specified using -f are concatenated to produce the expression.
|
||||
(For example, you can define functions in one file and call them from another.)
|
||||
-e {expression}: You can use this after -f to add an expression. Example use
|
||||
case: define functions/subroutines in a file you specify with -f, then call
|
||||
them with an expression you specify with -e.
|
||||
(If you mix -e and -f then the expressions are evaluated in the order encountered.
|
||||
Since the expression pieces are simply concatenated, please be sure to use intervening
|
||||
semicolons to separate expressions.)
|
||||
--no-fflush: for emit, tee, print, and dump, don't call fflush() after every
|
||||
record.
|
||||
Any of the output-format command-line flags (see mlr -h). Example: using
|
||||
mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ...
|
||||
the input is CSV, the output is pretty-print tabular, but the tee-file output
|
||||
is written in JSON format.
|
||||
|
||||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables. The environment-variable name may be an expression, e.g. a field
|
||||
value.
|
||||
|
||||
Use # to comment to end of line.
|
||||
</pre>
|
||||
</div>
|
||||
<p/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue