add template output mode

This commit is contained in:
2025-12-08 21:53:44 +01:00
parent 2bb0cdb0af
commit db35d08385
11 changed files with 214 additions and 48 deletions

View File

@@ -23,9 +23,9 @@ import (
"slices"
"strings"
"github.com/spf13/cobra"
"codeberg.org/scip/tablizer/cfg"
"codeberg.org/scip/tablizer/lib"
"github.com/spf13/cobra"
)
func completion(cmd *cobra.Command, mode string) error {
@@ -179,6 +179,8 @@ func Execute() {
"Enable ASCII output (default)")
rootCmd.MarkFlagsMutuallyExclusive("extended", "markdown", "orgtbl",
"shell", "yaml", "csv")
rootCmd.PersistentFlags().StringVarP(&conf.Template, "template", "P", "",
"template for template output mode")
// config file
rootCmd.PersistentFlags().StringVarP(&conf.Configfile, "config", "f", cfg.DefaultConfigfile,