2022-11-14 03:26:23 +01:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
2022-11-14 03:26:23 +01:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
// rootCmd represents the base command when called without any subcommands
|
|
|
|
var rootCmd = &cobra.Command{
|
2023-09-14 04:46:49 +02:00
|
|
|
Use: "hishtory",
|
2022-11-15 05:55:10 +01:00
|
|
|
Short: "hiSHtory: Better shell history",
|
2022-11-14 03:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-15 05:18:22 +01:00
|
|
|
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
|
2022-11-15 05:18:22 +01:00
|
|
|
}
|