Add -p flag to config

This commit is contained in:
Dan Jones 2024-05-08 15:04:18 -05:00
commit bddf8e1458

View file

@ -32,6 +32,11 @@ var configCmd = &cobra.Command{
//Long: ``,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) (err error) {
print, _ := cmd.Flags().GetBool("print")
if print {
fmt.Fprintln(cmd.OutOrStdout(), config.ConfigPath)
return nil
}
force, _ := cmd.Flags().GetBool("force")
if !force {
_, err = os.Stat(config.ConfigPath)
@ -60,4 +65,5 @@ func init() {
rootCmd.AddCommand(configCmd)
configCmd.Flags().BoolP("force", "f", false, "Force overwrite")
configCmd.Flags().BoolP("print", "p", false, "Print path only")
}