diff --git a/docs/src/manpage.md b/docs/src/manpage.md index a65598ee8..acbf21a25 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -569,6 +569,9 @@ MISCELLANEOUS FLAGS only. (Same as `--from /dev/null`.) Also useful in `mlr -n put -v '...'` for analyzing abstract syntax trees (if that's your thing). + -s {file name} Take command-line flags from file name. For more + information please see + https://miller.readthedocs.io/en/latest/scripting/. OUTPUT-COLORIZATION FLAGS Miller uses colors to highlight outputs. You can specify color preferences. diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index eb19cd389..101bfca26 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -548,6 +548,9 @@ MISCELLANEOUS FLAGS only. (Same as `--from /dev/null`.) Also useful in `mlr -n put -v '...'` for analyzing abstract syntax trees (if that's your thing). + -s {file name} Take command-line flags from file name. For more + information please see + https://miller.readthedocs.io/en/latest/scripting/. OUTPUT-COLORIZATION FLAGS Miller uses colors to highlight outputs. You can specify color preferences. diff --git a/docs/src/reference-main-flag-list.md b/docs/src/reference-main-flag-list.md index 9bafc8baf..aa48bce2b 100644 --- a/docs/src/reference-main-flag-list.md +++ b/docs/src/reference-main-flag-list.md @@ -273,6 +273,7 @@ These are flags which don't fit into any other category. * `--tz {timezone}`: Specify timezone, overriding `$TZ` environment variable (if any). * `-I`: Process files in-place. For each file name on the command line, output is written to a temp file in the same directory, which is then renamed over the original. Each file is processed in isolation: if the output format is CSV, CSV headers will be present in each output file, statistics are only over each file's own records; and so on. * `-n`: Process no input files, nor standard input either. Useful for `mlr put` with `begin`/`end` statements only. (Same as `--from /dev/null`.) Also useful in `mlr -n put -v '...'` for analyzing abstract syntax trees (if that's your thing). +* `-s {file name}`: Take command-line flags from file name. For more information please see https://miller.readthedocs.io/en/latest/scripting/. ## Output-colorization flags diff --git a/internal/pkg/cli/option_parse.go b/internal/pkg/cli/option_parse.go index 6a766cdaf..cfbbe4117 100644 --- a/internal/pkg/cli/option_parse.go +++ b/internal/pkg/cli/option_parse.go @@ -2902,5 +2902,16 @@ has its own overhead.`, *pargi += 1 }, }, + + { + name: "-s", + arg: "{file name}", + help: `Take command-line flags from file name. For more information please see ` + + lib.DOC_URL + `/en/latest/scripting/.`, + parser: func(args []string, argc int, pargi *int, options *TOptions) { + // Already handled in main(). Nothing to do here except to accept this as valid syntax. + *pargi += 2 + }, + }, }, } diff --git a/man/manpage.txt b/man/manpage.txt index eb19cd389..101bfca26 100644 --- a/man/manpage.txt +++ b/man/manpage.txt @@ -548,6 +548,9 @@ MISCELLANEOUS FLAGS only. (Same as `--from /dev/null`.) Also useful in `mlr -n put -v '...'` for analyzing abstract syntax trees (if that's your thing). + -s {file name} Take command-line flags from file name. For more + information please see + https://miller.readthedocs.io/en/latest/scripting/. OUTPUT-COLORIZATION FLAGS Miller uses colors to highlight outputs. You can specify color preferences. diff --git a/man/mlr.1 b/man/mlr.1 index 5a1cb77c6..e2a12b478 100644 --- a/man/mlr.1 +++ b/man/mlr.1 @@ -659,6 +659,9 @@ These are flags which don't fit into any other category. only. (Same as `--from /dev/null`.) Also useful in `mlr -n put -v '...'` for analyzing abstract syntax trees (if that's your thing). +-s {file name} Take command-line flags from file name. For more + information please see + https://miller.readthedocs.io/en/latest/scripting/. .fi .if n \{\ .RE