Codevault initial commit

This commit is contained in:
2026-08-16 16:23:14 +03:00
commit 6ee80f1c8f
47 changed files with 3177 additions and 0 deletions

17
internal/utils/env.go Normal file
View File

@@ -0,0 +1,17 @@
package utils
import (
"os"
"github.com/spf13/cobra"
)
func TryFlagFromEnv(cmd *cobra.Command, flag string, envvar string, required bool) {
if value, ok := os.LookupEnv(envvar); ok {
_ = cmd.Flags().Set(flag, value)
return
}
if required {
cmd.MarkFlagRequired(flag)
}
}