added transpose function (-T + -R)

This commit is contained in:
2025-01-12 19:28:52 +01:00
committed by T.v.Dein
parent 8792c5a40f
commit 4d894a728b
9 changed files with 271 additions and 134 deletions

View File

@@ -150,6 +150,8 @@ func Execute() {
"Custom field separator")
rootCmd.PersistentFlags().StringVarP(&conf.Columns, "columns", "c", "",
"Only show the speficied columns (separated by ,)")
rootCmd.PersistentFlags().StringVarP(&conf.TransposeColumns, "transpose-columns", "T", "",
"Transpose the speficied columns (separated by ,)")
// sort options
rootCmd.PersistentFlags().IntVarP(&conf.SortByColumn, "sort-by", "k", 0,
@@ -195,6 +197,7 @@ func Execute() {
// filters
rootCmd.PersistentFlags().StringArrayVarP(&conf.Rawfilters, "filter", "F", nil, "Filter by field (field=regexp)")
rootCmd.PersistentFlags().StringArrayVarP(&conf.Transposers, "regex-transposer", "R", nil, "apply /search/replace/ regexp to fields given in -T")
rootCmd.SetUsageTemplate(strings.TrimSpace(usage) + "\n")