From f9f4a8e99a7df8061502cbc00a40a682f0436300 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sun, 4 Jun 2023 14:22:20 -0400 Subject: [PATCH] make-dev artifacts --- docs/src/manpage.md | 48 +++++++++++------------ docs/src/manpage.txt | 48 +++++++++++------------ docs/src/reference-verbs.md | 67 ++++++++++++++++++-------------- man/manpage.txt | 48 +++++++++++------------ man/mlr.1 | 68 ++++++++++++++------------------- test/cases/cli-help/0001/expout | 32 +++++++--------- 6 files changed, 148 insertions(+), 163 deletions(-) diff --git a/docs/src/manpage.md b/docs/src/manpage.md index 65ffe0d8c..bcec7ff9e 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -192,15 +192,14 @@ MILLER(1) MILLER(1) for all things with "map" in their names. 1mVERB LIST0m - altkv bar bootstrap cat check clean-whitespace count-distinct count - count-similar cut decimate downcase fill-down fill-empty filter flatten - format-values fraction gap grep group-by group-like having-fields head - histogram json-parse json-stringify join label latin1-to-utf8 least-frequent - merge-fields most-frequent nest nothing put regularize remove-empty-columns - rename reorder repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle - skip-trivial-records sort sort-within-records split stats1 stats2 step summary - tac tail tee template top utf8-to-latin1 unflatten uniq unspace unsparsify - upcase + altkv bar bootstrap case cat check clean-whitespace count-distinct count + count-similar cut decimate fill-down fill-empty filter flatten format-values + fraction gap grep group-by group-like having-fields head histogram json-parse + json-stringify join label latin1-to-utf8 least-frequent merge-fields + most-frequent nest nothing put regularize remove-empty-columns rename reorder + repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle skip-trivial-records + sort sort-within-records split stats1 stats2 step summary tac tail tee + template top utf8-to-latin1 unflatten uniq unspace unsparsify 1mFUNCTION LIST0m abs acos acosh any append apply arrayify asin asinh asserting_absent @@ -909,6 +908,19 @@ MILLER(1) MILLER(1) Must be non-negative. -h|--help Show this message. + 1mcase0m + Usage: mlr case [options] + Uppercases strings in record keys and/or values. + Options: + -k Case only keys, not keys and values. + -v Case only values, not keys and values. + -f {a,b,c} Specify which field names to case (default: all) + -u Convert to uppercase + -l Convert to lowercase + -s Convert to sentence case (capitalize first letter) + -t Convert to title case (capitalize words) + -h|--help Show this message. + 1mcat0m Usage: mlr cat [options] Passes input records directly to output. Most useful for format conversion. @@ -1006,14 +1018,6 @@ MILLER(1) MILLER(1) -n {n} Decimation factor (default 10). -h|--help Show this message. - 1mdowncase0m - Usage: mlr downcase [options] - Lowercases strings in record keys and/or values. - Options: - -k Downcase only keys, not keys and values. - -v Downcase only values, not keys and values. - -h|--help Show this message. - 1mfill-down0m Usage: mlr fill-down [options] If a given record has a missing value for a given field, fill that from @@ -2127,14 +2131,6 @@ MILLER(1) MILLER(1) being 'b=3,c=4', then the output is the two records 'a=1,b=2,c=' and 'a=,b=3,c=4'. - 1mupcase0m - Usage: mlr upcase [options] - Uppercases strings in record keys and/or values. - Options: - -k Upcase only keys, not keys and values. - -v Upcase only values, not keys and values. - -h|--help Show this message. - 1mFUNCTIONS FOR FILTER/PUT0m 1mabs0m (class=math #args=1) Absolute value. @@ -3358,5 +3354,5 @@ MILLER(1) MILLER(1) - 2023-06-03 MILLER(1) + 2023-06-04 MILLER(1) diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index 3d89f78db..24af81017 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -171,15 +171,14 @@ MILLER(1) MILLER(1) for all things with "map" in their names. 1mVERB LIST0m - altkv bar bootstrap cat check clean-whitespace count-distinct count - count-similar cut decimate downcase fill-down fill-empty filter flatten - format-values fraction gap grep group-by group-like having-fields head - histogram json-parse json-stringify join label latin1-to-utf8 least-frequent - merge-fields most-frequent nest nothing put regularize remove-empty-columns - rename reorder repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle - skip-trivial-records sort sort-within-records split stats1 stats2 step summary - tac tail tee template top utf8-to-latin1 unflatten uniq unspace unsparsify - upcase + altkv bar bootstrap case cat check clean-whitespace count-distinct count + count-similar cut decimate fill-down fill-empty filter flatten format-values + fraction gap grep group-by group-like having-fields head histogram json-parse + json-stringify join label latin1-to-utf8 least-frequent merge-fields + most-frequent nest nothing put regularize remove-empty-columns rename reorder + repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle skip-trivial-records + sort sort-within-records split stats1 stats2 step summary tac tail tee + template top utf8-to-latin1 unflatten uniq unspace unsparsify 1mFUNCTION LIST0m abs acos acosh any append apply arrayify asin asinh asserting_absent @@ -888,6 +887,19 @@ MILLER(1) MILLER(1) Must be non-negative. -h|--help Show this message. + 1mcase0m + Usage: mlr case [options] + Uppercases strings in record keys and/or values. + Options: + -k Case only keys, not keys and values. + -v Case only values, not keys and values. + -f {a,b,c} Specify which field names to case (default: all) + -u Convert to uppercase + -l Convert to lowercase + -s Convert to sentence case (capitalize first letter) + -t Convert to title case (capitalize words) + -h|--help Show this message. + 1mcat0m Usage: mlr cat [options] Passes input records directly to output. Most useful for format conversion. @@ -985,14 +997,6 @@ MILLER(1) MILLER(1) -n {n} Decimation factor (default 10). -h|--help Show this message. - 1mdowncase0m - Usage: mlr downcase [options] - Lowercases strings in record keys and/or values. - Options: - -k Downcase only keys, not keys and values. - -v Downcase only values, not keys and values. - -h|--help Show this message. - 1mfill-down0m Usage: mlr fill-down [options] If a given record has a missing value for a given field, fill that from @@ -2106,14 +2110,6 @@ MILLER(1) MILLER(1) being 'b=3,c=4', then the output is the two records 'a=1,b=2,c=' and 'a=,b=3,c=4'. - 1mupcase0m - Usage: mlr upcase [options] - Uppercases strings in record keys and/or values. - Options: - -k Upcase only keys, not keys and values. - -v Upcase only values, not keys and values. - -h|--help Show this message. - 1mFUNCTIONS FOR FILTER/PUT0m 1mabs0m (class=math #args=1) Absolute value. @@ -3337,4 +3333,4 @@ MILLER(1) MILLER(1) - 2023-06-03 MILLER(1) + 2023-06-04 MILLER(1) diff --git a/docs/src/reference-verbs.md b/docs/src/reference-verbs.md index 0558f99d5..be11f8903 100644 --- a/docs/src/reference-verbs.md +++ b/docs/src/reference-verbs.md @@ -233,6 +233,45 @@ orange 0.4802164827586204 290 green 0.5129018241860459 1075 +## case + +
+mlr case --help
+
+
+Usage: mlr case [options]
+Uppercases strings in record keys and/or values.
+Options:
+-k  Case only keys, not keys and values.
+-v  Case only values, not keys and values.
+-f  {a,b,c} Specify which field names to case (default: all)
+-u  Convert to uppercase
+-l  Convert to lowercase
+-s  Convert to sentence case (capitalize first letter)
+-t  Convert to title case (capitalize words)
+-h|--help Show this message.
+
+ +
+mlr --from test/input/cases.csv --icsv --ojson case -u
+
+ +
+mlr --from test/input/cases.csv --icsv --ojson case -u -k
+
+ +
+mlr --from test/input/cases.csv --icsv --ojson case -u -v
+
+ +
+mlr --from test/input/cases.csv --icsv --ojson case -k -t then case -v -s
+
+ +
+mlr --from test/input/cases.csv --icsv --ojson case -u -f apple,ball then case -l -f cat,dog
+
+ ## cat Most useful for format conversions (see [File Formats](file-formats.md)) and concatenating multiple same-schema CSV files to have the same header: @@ -824,20 +863,6 @@ Options: -h|--help Show this message. -## downcase - -
-mlr downcase --help
-
-
-Usage: mlr downcase [options]
-Lowercases strings in record keys and/or values.
-Options:
--k        Downcase only keys, not keys and values.
--v        Downcase only values, not keys and values.
--h|--help Show this message.
-
- ## fill-down
@@ -4288,17 +4313,3 @@ a b v u w x
 1 - 2 - - 3
 - - 1 - 2 -
 
- -## upcase - -
-mlr upcase --help
-
-
-Usage: mlr upcase [options]
-Uppercases strings in record keys and/or values.
-Options:
--k        Upcase only keys, not keys and values.
--v        Upcase only values, not keys and values.
--h|--help Show this message.
-
diff --git a/man/manpage.txt b/man/manpage.txt index 3d89f78db..24af81017 100644 --- a/man/manpage.txt +++ b/man/manpage.txt @@ -171,15 +171,14 @@ MILLER(1) MILLER(1) for all things with "map" in their names. 1mVERB LIST0m - altkv bar bootstrap cat check clean-whitespace count-distinct count - count-similar cut decimate downcase fill-down fill-empty filter flatten - format-values fraction gap grep group-by group-like having-fields head - histogram json-parse json-stringify join label latin1-to-utf8 least-frequent - merge-fields most-frequent nest nothing put regularize remove-empty-columns - rename reorder repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle - skip-trivial-records sort sort-within-records split stats1 stats2 step summary - tac tail tee template top utf8-to-latin1 unflatten uniq unspace unsparsify - upcase + altkv bar bootstrap case cat check clean-whitespace count-distinct count + count-similar cut decimate fill-down fill-empty filter flatten format-values + fraction gap grep group-by group-like having-fields head histogram json-parse + json-stringify join label latin1-to-utf8 least-frequent merge-fields + most-frequent nest nothing put regularize remove-empty-columns rename reorder + repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle skip-trivial-records + sort sort-within-records split stats1 stats2 step summary tac tail tee + template top utf8-to-latin1 unflatten uniq unspace unsparsify 1mFUNCTION LIST0m abs acos acosh any append apply arrayify asin asinh asserting_absent @@ -888,6 +887,19 @@ MILLER(1) MILLER(1) Must be non-negative. -h|--help Show this message. + 1mcase0m + Usage: mlr case [options] + Uppercases strings in record keys and/or values. + Options: + -k Case only keys, not keys and values. + -v Case only values, not keys and values. + -f {a,b,c} Specify which field names to case (default: all) + -u Convert to uppercase + -l Convert to lowercase + -s Convert to sentence case (capitalize first letter) + -t Convert to title case (capitalize words) + -h|--help Show this message. + 1mcat0m Usage: mlr cat [options] Passes input records directly to output. Most useful for format conversion. @@ -985,14 +997,6 @@ MILLER(1) MILLER(1) -n {n} Decimation factor (default 10). -h|--help Show this message. - 1mdowncase0m - Usage: mlr downcase [options] - Lowercases strings in record keys and/or values. - Options: - -k Downcase only keys, not keys and values. - -v Downcase only values, not keys and values. - -h|--help Show this message. - 1mfill-down0m Usage: mlr fill-down [options] If a given record has a missing value for a given field, fill that from @@ -2106,14 +2110,6 @@ MILLER(1) MILLER(1) being 'b=3,c=4', then the output is the two records 'a=1,b=2,c=' and 'a=,b=3,c=4'. - 1mupcase0m - Usage: mlr upcase [options] - Uppercases strings in record keys and/or values. - Options: - -k Upcase only keys, not keys and values. - -v Upcase only values, not keys and values. - -h|--help Show this message. - 1mFUNCTIONS FOR FILTER/PUT0m 1mabs0m (class=math #args=1) Absolute value. @@ -3337,4 +3333,4 @@ MILLER(1) MILLER(1) - 2023-06-03 MILLER(1) + 2023-06-04 MILLER(1) diff --git a/man/mlr.1 b/man/mlr.1 index 08ad3e578..7f16b922b 100644 --- a/man/mlr.1 +++ b/man/mlr.1 @@ -2,12 +2,12 @@ .\" Title: mlr .\" Author: [see the "AUTHOR" section] .\" Generator: ./mkman.rb -.\" Date: 2023-06-03 +.\" Date: 2023-06-04 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "MILLER" "1" "2023-06-03" "\ \&" "\ \&" +.TH "MILLER" "1" "2023-06-04" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Portability definitions .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -212,15 +212,14 @@ for all things with "map" in their names. .RS 0 .\} .nf -altkv bar bootstrap cat check clean-whitespace count-distinct count -count-similar cut decimate downcase fill-down fill-empty filter flatten -format-values fraction gap grep group-by group-like having-fields head -histogram json-parse json-stringify join label latin1-to-utf8 least-frequent -merge-fields most-frequent nest nothing put regularize remove-empty-columns -rename reorder repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle -skip-trivial-records sort sort-within-records split stats1 stats2 step summary -tac tail tee template top utf8-to-latin1 unflatten uniq unspace unsparsify -upcase +altkv bar bootstrap case cat check clean-whitespace count-distinct count +count-similar cut decimate fill-down fill-empty filter flatten format-values +fraction gap grep group-by group-like having-fields head histogram json-parse +json-stringify join label latin1-to-utf8 least-frequent merge-fields +most-frequent nest nothing put regularize remove-empty-columns rename reorder +repeat reshape sample sec2gmtdate sec2gmt seqgen shuffle skip-trivial-records +sort sort-within-records split stats1 stats2 step summary tac tail tee +template top utf8-to-latin1 unflatten uniq unspace unsparsify .fi .if n \{\ .RE @@ -1079,6 +1078,25 @@ Options: .fi .if n \{\ .RE +.SS "case" +.if n \{\ +.RS 0 +.\} +.nf +Usage: mlr case [options] +Uppercases strings in record keys and/or values. +Options: +-k Case only keys, not keys and values. +-v Case only values, not keys and values. +-f {a,b,c} Specify which field names to case (default: all) +-u Convert to uppercase +-l Convert to lowercase +-s Convert to sentence case (capitalize first letter) +-t Convert to title case (capitalize words) +-h|--help Show this message. +.fi +.if n \{\ +.RE .SS "cat" .if n \{\ .RS 0 @@ -1224,20 +1242,6 @@ Options: .fi .if n \{\ .RE -.SS "downcase" -.if n \{\ -.RS 0 -.\} -.nf -Usage: mlr downcase [options] -Lowercases strings in record keys and/or values. -Options: --k Downcase only keys, not keys and values. --v Downcase only values, not keys and values. --h|--help Show this message. -.fi -.if n \{\ -.RE .SS "fill-down" .if n \{\ .RS 0 @@ -2669,20 +2673,6 @@ being 'b=3,c=4', then the output is the two records 'a=1,b=2,c=' and .fi .if n \{\ .RE -.SS "upcase" -.if n \{\ -.RS 0 -.\} -.nf -Usage: mlr upcase [options] -Uppercases strings in record keys and/or values. -Options: --k Upcase only keys, not keys and values. --v Upcase only values, not keys and values. --h|--help Show this message. -.fi -.if n \{\ -.RE .SH "FUNCTIONS FOR FILTER/PUT" .sp diff --git a/test/cases/cli-help/0001/expout b/test/cases/cli-help/0001/expout index fe29d65db..45dc38c63 100644 --- a/test/cases/cli-help/0001/expout +++ b/test/cases/cli-help/0001/expout @@ -34,6 +34,20 @@ Options: Must be non-negative. -h|--help Show this message. +================================================================ +case +Usage: mlr case [options] +Uppercases strings in record keys and/or values. +Options: +-k Case only keys, not keys and values. +-v Case only values, not keys and values. +-f {a,b,c} Specify which field names to case (default: all) +-u Convert to uppercase +-l Convert to lowercase +-s Convert to sentence case (capitalize first letter) +-t Convert to title case (capitalize words) +-h|--help Show this message. + ================================================================ cat Usage: mlr cat [options] @@ -139,15 +153,6 @@ Options: -n {n} Decimation factor (default 10). -h|--help Show this message. -================================================================ -downcase -Usage: mlr downcase [options] -Lowercases strings in record keys and/or values. -Options: --k Downcase only keys, not keys and values. --v Downcase only values, not keys and values. --h|--help Show this message. - ================================================================ fill-down Usage: mlr fill-down [options] @@ -1313,13 +1318,4 @@ Options: Example: if the input is two records, one being 'a=1,b=2' and the other being 'b=3,c=4', then the output is the two records 'a=1,b=2,c=' and 'a=,b=3,c=4'. - -================================================================ -upcase -Usage: mlr upcase [options] -Uppercases strings in record keys and/or values. -Options: --k Upcase only keys, not keys and values. --v Upcase only values, not keys and values. --h|--help Show this message. ================================================================