mirror of
https://github.com/foomo/squadron.git
synced 2025-10-16 12:35:42 +00:00
refactor: move flagFiles to global scope
This commit is contained in:
parent
a1ca047c9a
commit
d63de3e65e
@ -6,10 +6,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
generateCmd.Flags().StringSliceVarP(&flagFiles, "file", "f", []string{}, "Configuration file to merge")
|
||||
}
|
||||
|
||||
var (
|
||||
generateCmd = &cobra.Command{
|
||||
Use: "generate [UNIT...]",
|
||||
|
||||
@ -33,7 +33,9 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.PersistentFlags().BoolVarP(&flagVerbose, "verbose", "v", false, "Show more ouput")
|
||||
rootCmd.PersistentFlags().BoolVarP(&flagVerbose, "verbose", "v", false, "show more output")
|
||||
rootCmd.PersistentFlags().StringSliceVarP(&flagFiles, "file", "f", []string{"squadron.yaml"}, "specify alternative squadron files")
|
||||
|
||||
rootCmd.AddCommand(upCmd, downCmd, buildCmd, generateCmd, configCmd, versionCmd, completionCmd)
|
||||
}
|
||||
|
||||
|
||||
@ -7,10 +7,9 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
upCmd.Flags().StringVarP(&flagNamespace, "namespace", "n", "default", "Specifies the namespace")
|
||||
upCmd.Flags().StringSliceVarP(&flagFiles, "file", "f", []string{}, "Configuration file to merge")
|
||||
upCmd.Flags().BoolVarP(&flagBuild, "build", "b", false, "Build service squadron before publishing")
|
||||
upCmd.Flags().BoolVarP(&flagPush, "push", "p", false, "Pushes the built service to the registry")
|
||||
upCmd.Flags().StringVarP(&flagNamespace, "namespace", "n", "default", "specifies the namespace")
|
||||
upCmd.Flags().BoolVarP(&flagBuild, "build", "b", false, "builds or rebuilds units")
|
||||
upCmd.Flags().BoolVarP(&flagPush, "push", "p", false, "pushes units to the registry")
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user