feat(config): add config parent command and path subcommand

This commit is contained in:
Lewis Wynne 2026-02-11 23:34:20 +00:00
parent 3f6ddfbcd4
commit e4a5e7f715
3 changed files with 35 additions and 0 deletions

32
cmd/config_cmd.go Normal file
View file

@ -0,0 +1,32 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var configCmd = &cobra.Command{
Use: "config",
Short: "View and modify configuration",
}
var configPathCmd = &cobra.Command{
Use: "path",
Short: "Print config file path",
Args: cobra.NoArgs,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
p, err := configPath()
if err != nil {
return fmt.Errorf("cannot determine config path: %w", err)
}
fmt.Println(p)
return nil
},
}
func init() {
configCmd.AddCommand(configPathCmd)
rootCmd.AddCommand(configCmd)
}