mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-18 13:01:11 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c87da34f2 |
@@ -28,7 +28,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const DefaultSeparator string = `(\s\s+|\t)`
|
const DefaultSeparator string = `(\s\s+|\t)`
|
||||||
const Version string = "v1.5.6"
|
const Version string = "v1.5.7"
|
||||||
const MAXPARTS = 2
|
const MAXPARTS = 2
|
||||||
|
|
||||||
var DefaultConfigfile = os.Getenv("HOME") + "/.config/tablizer/config"
|
var DefaultConfigfile = os.Getenv("HOME") + "/.config/tablizer/config"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@@ -187,6 +188,11 @@ func Execute() {
|
|||||||
|
|
||||||
rootCmd.SetUsageTemplate(strings.TrimSpace(usage) + "\n")
|
rootCmd.SetUsageTemplate(strings.TrimSpace(usage) + "\n")
|
||||||
|
|
||||||
|
if slices.Contains(os.Args, "-h") {
|
||||||
|
fmt.Println(shortusage)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
err := rootCmd.Execute()
|
err := rootCmd.Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
16
cmd/shortusage.go
Normal file
16
cmd/shortusage.go
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
const shortusage = `tablizer [regex,...] [-r file] [flags]
|
||||||
|
-c col,... show specified columns -L highlight matching lines
|
||||||
|
-k col,... sort by specified columns -j read JSON input
|
||||||
|
-F col=reg filter field with regexp -v invert match
|
||||||
|
-T col,... transpose specified columns -n numberize columns
|
||||||
|
-R /from/to/ apply replacement to columns in -T -N do not use colors
|
||||||
|
-y col,... yank columns to clipboard -H do not show headers
|
||||||
|
--ofs char output field separator -s specify field separator
|
||||||
|
-r file read input from file -z use fuzzy search
|
||||||
|
-f file read config from file -I interactive filter mode
|
||||||
|
-d debug
|
||||||
|
-O org -C CSV -M md -X ext -S shell -Y yaml -D sort descending order
|
||||||
|
-m show manual --help show detailed help -v show version
|
||||||
|
-a sort by age -i sort numerically -t sort by time`
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
# usage
|
# usage
|
||||||
exec tablizer -h
|
exec tablizer --help
|
||||||
stdout Usage
|
stdout Usage
|
||||||
|
|
||||||
|
exec tablizer -h
|
||||||
|
stdout show
|
||||||
|
|
||||||
# version
|
# version
|
||||||
exec tablizer -V
|
exec tablizer -V
|
||||||
stdout version
|
stdout version
|
||||||
|
|||||||
Reference in New Issue
Block a user