Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Examples:

# Bundle using metadata.yaml for name/version
windsor bundle`,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
// Get shared dependency injector from context
injector := cmd.Context().Value(injectorKey).(di.Injector)
Expand Down
25 changes: 14 additions & 11 deletions cmd/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ var getContextCmd = &cobra.Command{

// setContextCmd represents the set command
var setContextCmd = &cobra.Command{
Use: "set [context]",
Short: "Set the current context",
Long: "Set the current context in the configuration and save it",
Args: cobra.ExactArgs(1), // Ensure exactly one argument is provided
Use: "set [context]",
Short: "Set the current context",
Long: "Set the current context in the configuration and save it",
Args: cobra.ExactArgs(1), // Ensure exactly one argument is provided
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
// Get shared dependency injector from context
injector := cmd.Context().Value(injectorKey).(di.Injector)
Expand Down Expand Up @@ -80,9 +81,10 @@ var setContextCmd = &cobra.Command{

// getContextAliasCmd is an alias for the get command
var getContextAliasCmd = &cobra.Command{
Use: "get-context",
Short: "Alias for 'context get'",
Long: "Alias for 'context get'",
Use: "get-context",
Short: "Alias for 'context get'",
Long: "Alias for 'context get'",
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
rootCmd.SetArgs(append([]string{"context", "get"}, args...))
return rootCmd.Execute()
Expand All @@ -91,10 +93,11 @@ var getContextAliasCmd = &cobra.Command{

// setContextAliasCmd is an alias for the set command
var setContextAliasCmd = &cobra.Command{
Use: "set-context [context]",
Short: "Alias for 'context set'",
Long: "Alias for 'context set'",
Args: cobra.ExactArgs(1), // Ensure exactly one argument is provided
Use: "set-context [context]",
Short: "Alias for 'context set'",
SilenceUsage: true,
Long: "Alias for 'context set'",
Args: cobra.ExactArgs(1), // Ensure exactly one argument is provided
RunE: func(cmd *cobra.Command, args []string) error {
rootCmd.SetArgs(append([]string{"context", "set"}, args...))
return rootCmd.Execute()
Expand Down
9 changes: 5 additions & 4 deletions cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import (

// execCmd represents the exec command
var execCmd = &cobra.Command{
Use: "exec [command] [args...]",
Short: "Execute a command with environment variables",
Long: "Execute a command with environment variables loaded from configuration and secrets",
Args: cobra.MinimumNArgs(1),
Use: "exec [command] [args...]",
Short: "Execute a command with environment variables",
Long: "Execute a command with environment variables loaded from configuration and secrets",
Args: cobra.MinimumNArgs(1),
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
// Safety check for arguments
if len(args) == 0 {
Expand Down
9 changes: 5 additions & 4 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ var (
)

var initCmd = &cobra.Command{
Use: "init [context]",
Short: "Initialize the application environment",
Long: "Initialize the application environment with the specified context configuration",
Args: cobra.MaximumNArgs(1),
Use: "init [context]",
Short: "Initialize the application environment",
Long: "Initialize the application environment with the specified context configuration",
Args: cobra.MaximumNArgs(1),
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
injector := cmd.Context().Value(injectorKey).(di.Injector)
ctx := cmd.Context()
Expand Down
7 changes: 4 additions & 3 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ var Goos = runtime.GOOS

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Display the current version",
Long: "Display the current version of the application",
Use: "version",
Short: "Display the current version",
Long: "Display the current version of the application",
SilenceUsage: true,
Run: func(cmd *cobra.Command, args []string) {
platform := fmt.Sprintf("%s/%s", Goos, runtime.GOARCH)
cmd.Printf("Version: %s\nCommit SHA: %s\nPlatform: %s\n", version, commitSHA, platform)
Expand Down
Loading