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"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
generateCmd.Flags().StringSliceVarP(&flagFiles, "file", "f", []string{}, "Configuration file to merge")
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
generateCmd = &cobra.Command{
|
generateCmd = &cobra.Command{
|
||||||
Use: "generate [UNIT...]",
|
Use: "generate [UNIT...]",
|
||||||
|
|||||||
@ -33,7 +33,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
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)
|
rootCmd.AddCommand(upCmd, downCmd, buildCmd, generateCmd, configCmd, versionCmd, completionCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,10 +7,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
upCmd.Flags().StringVarP(&flagNamespace, "namespace", "n", "default", "Specifies the namespace")
|
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, "builds or rebuilds units")
|
||||||
upCmd.Flags().BoolVarP(&flagBuild, "build", "b", false, "Build service squadron before publishing")
|
upCmd.Flags().BoolVarP(&flagPush, "push", "p", false, "pushes units to the registry")
|
||||||
upCmd.Flags().BoolVarP(&flagPush, "push", "p", false, "Pushes the built service to the registry")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user