From c9e0559cf66e5f7902346bb2a11ccb19f0935446 Mon Sep 17 00:00:00 2001 From: Fulvio Scapin Date: Mon, 1 Aug 2022 15:53:40 +0200 Subject: [PATCH] [Docs] moving --xvright out of the FLATTEN-UNFLATTEN FLAGS section (#1065) --- docs/src/manpage.md | 2 +- docs/src/manpage.txt | 2 +- docs/src/reference-main-flag-list.md | 2 +- internal/pkg/cli/option_parse.go | 18 +++++++++--------- man/manpage.txt | 2 +- man/mlr.1 | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/src/manpage.md b/docs/src/manpage.md index 7576b9e43..04914adc9 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -394,6 +394,7 @@ FILE-FORMAT FLAGS --tsvlite Use TSV-lite format for input and output data. --usv or --usvlite Use USV format for input and output data. --xtab Use XTAB format for input and output data. + --xvright Right-justify values for XTAB format. -i {format name} Use format name for input data. For example: `-i csv` is the same as `--icsv`. -o {format name} Use format name for output data. For example: `-o @@ -419,7 +420,6 @@ FLATTEN-UNFLATTEN FLAGS `$y=[7,8,9]`. flattens to `y.1=7,y.2=8,y.3=9. With `--no-auto-flatten`, instead we get `${y.1}=7,${y.2}=8,${y.3}=9`. - --xvright Right-justify values for XTAB format. FORMAT-CONVERSION KEYSTROKE-SAVER FLAGS As keystroke-savers for format-conversion you may use the following. diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index 952c9a603..64433d9b6 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -373,6 +373,7 @@ FILE-FORMAT FLAGS --tsvlite Use TSV-lite format for input and output data. --usv or --usvlite Use USV format for input and output data. --xtab Use XTAB format for input and output data. + --xvright Right-justify values for XTAB format. -i {format name} Use format name for input data. For example: `-i csv` is the same as `--icsv`. -o {format name} Use format name for output data. For example: `-o @@ -398,7 +399,6 @@ FLATTEN-UNFLATTEN FLAGS `$y=[7,8,9]`. flattens to `y.1=7,y.2=8,y.3=9. With `--no-auto-flatten`, instead we get `${y.1}=7,${y.2}=8,${y.3}=9`. - --xvright Right-justify values for XTAB format. FORMAT-CONVERSION KEYSTROKE-SAVER FLAGS As keystroke-savers for format-conversion you may use the following. diff --git a/docs/src/reference-main-flag-list.md b/docs/src/reference-main-flag-list.md index 82ced4aa7..de8ee8053 100644 --- a/docs/src/reference-main-flag-list.md +++ b/docs/src/reference-main-flag-list.md @@ -181,6 +181,7 @@ are overridden in all cases by setting output format to `format2`. * `--tsvlite`: Use TSV-lite format for input and output data. * `--usv or --usvlite`: Use USV format for input and output data. * `--xtab`: Use XTAB format for input and output data. +* `--xvright`: Right-justify values for XTAB format. * `-i {format name}`: Use format name for input data. For example: `-i csv` is the same as `--icsv`. * `-o {format name}`: Use format name for output data. For example: `-o csv` is the same as `--ocsv`. @@ -196,7 +197,6 @@ See the Flatten/unflatten doc page for more information. * `--flatsep or --jflatsep {string}`: Separator for flattening multi-level JSON keys, e.g. `{"a":{"b":3}}` becomes `a:b => 3` for non-JSON formats. Defaults to `.`. * `--no-auto-flatten`: When output is non-JSON, suppress the default auto-flatten behavior. Default: if `$y = [7,8,9]` then this flattens to `y.1=7,y.2=8,y.3=9, and similarly for maps. With `--no-auto-flatten`, instead we get `$y=[1, 2, 3]`. * `--no-auto-unflatten`: When input non-JSON and output is JSON, suppress the default auto-unflatten behavior. Default: if the input has `y.1=7,y.2=8,y.3=9` then this unflattens to `$y=[7,8,9]`. flattens to `y.1=7,y.2=8,y.3=9. With `--no-auto-flatten`, instead we get `${y.1}=7,${y.2}=8,${y.3}=9`. -* `--xvright`: Right-justify values for XTAB format. ## Format-conversion keystroke-saver flags diff --git a/internal/pkg/cli/option_parse.go b/internal/pkg/cli/option_parse.go index ec62d076b..9389a63f3 100644 --- a/internal/pkg/cli/option_parse.go +++ b/internal/pkg/cli/option_parse.go @@ -1094,6 +1094,15 @@ var FileFormatFlagSection = FlagSection{ }, }, + { + name: "--xvright", + help: "Right-justify values for XTAB format.", + parser: func(args []string, argc int, pargi *int, options *TOptions) { + options.WriterOptions.RightAlignedXTABOutput = true + *pargi += 1 + }, + }, + { name: "--pprint", help: "Use PPRINT format for input and output data.", @@ -2572,15 +2581,6 @@ var FlattenUnflattenFlagSection = FlagSection{ }, }, - { - name: "--xvright", - help: "Right-justify values for XTAB format.", - parser: func(args []string, argc int, pargi *int, options *TOptions) { - options.WriterOptions.RightAlignedXTABOutput = true - *pargi += 1 - }, - }, - { name: "--no-auto-flatten", help: "When output is non-JSON, suppress the default auto-flatten behavior. Default: if `$y = [7,8,9]` then this flattens to `y.1=7,y.2=8,y.3=9, and similarly for maps. With `--no-auto-flatten`, instead we get `$y=[1, 2, 3]`.", diff --git a/man/manpage.txt b/man/manpage.txt index 952c9a603..64433d9b6 100644 --- a/man/manpage.txt +++ b/man/manpage.txt @@ -373,6 +373,7 @@ FILE-FORMAT FLAGS --tsvlite Use TSV-lite format for input and output data. --usv or --usvlite Use USV format for input and output data. --xtab Use XTAB format for input and output data. + --xvright Right-justify values for XTAB format. -i {format name} Use format name for input data. For example: `-i csv` is the same as `--icsv`. -o {format name} Use format name for output data. For example: `-o @@ -398,7 +399,6 @@ FLATTEN-UNFLATTEN FLAGS `$y=[7,8,9]`. flattens to `y.1=7,y.2=8,y.3=9. With `--no-auto-flatten`, instead we get `${y.1}=7,${y.2}=8,${y.3}=9`. - --xvright Right-justify values for XTAB format. FORMAT-CONVERSION KEYSTROKE-SAVER FLAGS As keystroke-savers for format-conversion you may use the following. diff --git a/man/mlr.1 b/man/mlr.1 index f73019d92..86047be40 100644 --- a/man/mlr.1 +++ b/man/mlr.1 @@ -452,6 +452,7 @@ are overridden in all cases by setting output format to `format2`. --tsvlite Use TSV-lite format for input and output data. --usv or --usvlite Use USV format for input and output data. --xtab Use XTAB format for input and output data. +--xvright Right-justify values for XTAB format. -i {format name} Use format name for input data. For example: `-i csv` is the same as `--icsv`. -o {format name} Use format name for output data. For example: `-o @@ -485,7 +486,6 @@ See the Flatten/unflatten doc page for more information. `$y=[7,8,9]`. flattens to `y.1=7,y.2=8,y.3=9. With `--no-auto-flatten`, instead we get `${y.1}=7,${y.2}=8,${y.3}=9`. ---xvright Right-justify values for XTAB format. .fi .if n \{\ .RE