From cf67f81eb107cf237e26ccf02a64240100b3425a Mon Sep 17 00:00:00 2001 From: Suraj B M Date: Sun, 28 Sep 2025 10:26:08 +0530 Subject: [PATCH] feat: implement pretty command --- cmd/pretty.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cmd/pretty.go diff --git a/cmd/pretty.go b/cmd/pretty.go new file mode 100644 index 0000000..201766f --- /dev/null +++ b/cmd/pretty.go @@ -0,0 +1,34 @@ +/* +Copyright © 2025 NAME HERE +*/ +package cmd + +import ( + "envy/cmd/utils" + + "github.com/spf13/cobra" +) + +// prettyCmd represents the pretty command +var prettyCmd = &cobra.Command{ + Use: "pretty", + Short: "Format .env file according to UNIX syntax", + Run: func(cmd *cobra.Command, args []string) { + err := utils.RefactorEnv() + utils.StopIfErr(err) + }, +} + +func init() { + rootCmd.AddCommand(prettyCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // prettyCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // prettyCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +}