-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to greatly simplify options, global flags, dry-run and docke…
…r command execution
- Loading branch information
Showing
9 changed files
with
82 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/silphid/yey/src/internal/logging" | ||
yey "github.com/silphid/yey/src/internal" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewRoot creates the root cobra command | ||
func NewRoot() *cobra.Command { | ||
c := &cobra.Command{ | ||
Use: "yey", | ||
Short: "A DevOps & CI/CD & Kubernetes-oriented general purpose Docker container with CLI launcher", | ||
Long: `A DevOps & CI/CD & Kubernetes-oriented general purpose Docker container with CLI launcher`, | ||
Short: "An interactive, human-friendly docker launcher for dev and devops", | ||
Long: "An interactive, human-friendly docker launcher for dev and devops", | ||
SilenceUsage: true, | ||
} | ||
|
||
// var options internal.Options | ||
c.PersistentFlags().BoolVarP(&logging.Verbose, "verbose", "v", false, "display verbose messages") | ||
c.PersistentFlags().BoolVarP(&yey.IsVerbose, "verbose", "v", false, "output verbose messages to stderr") | ||
c.PersistentFlags().BoolVar(&yey.IsDryRun, "dry-run", false, "output docker command to stdout instead of executing it") | ||
|
||
return c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.