Move cache flags to 'do' operation

Move cache flags to 'dagger do' as it will only become relevant for this dagger command

Signed-off-by: guillaume <guillaume.derouville@gmail.com>
This commit is contained in:
guillaume 2022-03-08 00:07:18 +01:00
parent 05cc2adec5
commit 8c54935349
2 changed files with 5 additions and 6 deletions

View File

@ -158,6 +158,11 @@ func doHelp(cmd *cobra.Command, _ []string) {
func init() {
doCmd.Flags().StringArrayP("with", "w", []string{}, "")
doCmd.Flags().StringP("plan", "p", ".", "Path to plan (defaults to current directory)")
doCmd.Flags().Bool("no-cache", false, "Disable caching")
doCmd.Flags().StringArray("cache-to", []string{},
"Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir)")
doCmd.Flags().StringArray("cache-from", []string{},
"External cache sources (eg. user/app:cache, type=local,src=path/to/dir)")
doCmd.SetHelpFunc(doHelp)

View File

@ -24,12 +24,6 @@ func init() {
rootCmd.PersistentFlags().String("log-format", "auto", "Log format (auto, plain, tty, json)")
rootCmd.PersistentFlags().StringP("log-level", "l", "info", "Log level")
rootCmd.PersistentFlags().Bool("no-cache", false, "Disable caching")
rootCmd.PersistentFlags().StringArray("cache-to", []string{},
"Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir)")
rootCmd.PersistentFlags().StringArray("cache-from", []string{},
"External cache sources (eg. user/app:cache, type=local,src=path/to/dir)")
rootCmd.PersistentPreRun = func(cmd *cobra.Command, _ []string) {
go checkVersion()
}