mirror of
https://github.com/silicoflare/envy.git
synced 2026-05-26 11:49:52 +05:30
feat: implement pretty command
This commit is contained in:
34
cmd/pretty.go
Normal file
34
cmd/pretty.go
Normal 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")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user