feat: implement pretty command

This commit is contained in:
2025-09-28 10:26:08 +05:30
parent e0dc9b7342
commit cf67f81eb1

34
cmd/pretty.go Normal file
View File

@@ -0,0 +1,34 @@
/*
Copyright © 2025 NAME HERE <EMAIL ADDRESS>
*/
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")
}