hishtory/client/cmd/root.go

35 lines
866 B
Go
Raw Normal View History

/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
"os"
2022-11-15 05:20:55 +01:00
"github.com/ddworken/hishtory/client/lib"
2024-08-11 21:19:41 +02:00
"github.com/spf13/cobra"
)
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "hishtory",
Short: "hiSHtory: Better shell history",
}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
rootCmd.AddGroup(&cobra.Group{ID: GROUP_ID_QUERYING, Title: "History Searching"})
rootCmd.AddGroup(&cobra.Group{ID: GROUP_ID_MANAGEMENT, Title: "History Management"})
rootCmd.AddGroup(&cobra.Group{ID: GROUP_ID_CONFIG, Title: "Configuration"})
2022-11-15 05:20:55 +01:00
rootCmd.Version = "v0." + lib.Version
}