mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-18 04:51:05 +01:00
Release v1.0.17 (#9)
* add shortcut -H to --no-headers, it's too cumbersome to type * added fuzzy search support * Added basic lisp plugin facilities * Lisp plugin Addidions: - added process hook facilities - added working example lisp plugin for filter hook - load-path can now be a file as well - added a couple of lisp helper functions (atoi, split), more may follow, see lisplib.go * linting fixes
This commit is contained in:
10
cmd/root.go
10
cmd/root.go
@@ -98,6 +98,12 @@ func Execute() {
|
||||
conf.DetermineColormode()
|
||||
conf.ApplyDefaults()
|
||||
|
||||
// setup lisp env, load plugins etc
|
||||
err := lib.SetupLisp(&conf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// actual execution starts here
|
||||
return lib.ProcessFiles(&conf, args)
|
||||
},
|
||||
@@ -111,6 +117,7 @@ func Execute() {
|
||||
rootCmd.PersistentFlags().BoolVarP(&ShowVersion, "version", "V", false, "Print program version")
|
||||
rootCmd.PersistentFlags().BoolVarP(&conf.InvertMatch, "invert-match", "v", false, "select non-matching rows")
|
||||
rootCmd.PersistentFlags().BoolVarP(&ShowManual, "man", "m", false, "Display manual page")
|
||||
rootCmd.PersistentFlags().BoolVarP(&conf.UseFuzzySearch, "fuzzy", "z", false, "Use fuzzy searching")
|
||||
rootCmd.PersistentFlags().StringVarP(&ShowCompletion, "completion", "", "", "Display completion code")
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.Separator, "separator", "s", cfg.DefaultSeparator, "Custom field separator")
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.Columns, "columns", "c", "", "Only show the speficied columns (separated by ,)")
|
||||
@@ -135,6 +142,9 @@ func Execute() {
|
||||
rootCmd.PersistentFlags().BoolVarP(&modeflag.A, "ascii", "A", false, "Enable ASCII output (default)")
|
||||
rootCmd.MarkFlagsMutuallyExclusive("extended", "markdown", "orgtbl", "shell", "yaml", "csv")
|
||||
|
||||
// lisp options
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.LispLoadPath, "load-path", "l", cfg.DefaultLoadPath, "Load path for lisp plugins (expects *.zy files)")
|
||||
|
||||
rootCmd.SetUsageTemplate(strings.TrimSpace(usage) + "\n")
|
||||
|
||||
err := rootCmd.Execute()
|
||||
|
||||
@@ -16,6 +16,7 @@ SYNOPSIS
|
||||
-H, --no-headers Disable headers display
|
||||
-s, --separator string Custom field separator
|
||||
-k, --sort-by int Sort by column (default: 1)
|
||||
-z, --fuzzy Use fuzzy seach [experimental]
|
||||
|
||||
Output Flags (mutually exclusive):
|
||||
-X, --extended Enable extended output
|
||||
@@ -138,6 +139,10 @@ DESCRIPTION
|
||||
|
||||
kubectl get pods -A | tablizer "(?i)account"
|
||||
|
||||
You can use the experimental fuzzy seach feature by providing the option
|
||||
-z, in which case the pattern is regarded as a fuzzy search term, not a
|
||||
regexp.
|
||||
|
||||
COLUMNS
|
||||
The parameter -c can be used to specify, which columns to display. By
|
||||
default tablizer numerizes the header names and these numbers can be
|
||||
@@ -302,6 +307,7 @@ Operational Flags:
|
||||
-H, --no-headers Disable headers display
|
||||
-s, --separator string Custom field separator
|
||||
-k, --sort-by int Sort by column (default: 1)
|
||||
-z, --fuzzy Use fuzzy seach [experimental]
|
||||
|
||||
Output Flags (mutually exclusive):
|
||||
-X, --extended Enable extended output
|
||||
@@ -320,6 +326,8 @@ Sort Mode Flags (mutually exclusive):
|
||||
|
||||
Other Flags:
|
||||
--completion <shell> Generate the autocompletion script for <shell>
|
||||
-l --load-path <path> Where to search for lisp plugins. Maybe a file or
|
||||
a directory containing files with *.zy extension
|
||||
-d, --debug Enable debugging
|
||||
-h, --help help for tablizer
|
||||
-m, --man Display manual page
|
||||
|
||||
Reference in New Issue
Block a user