cli: move client-only code out of the server flow

earlier, some of the client exclusive code was being run on zot server
instance too.

cli: fix the bug: spinner is not stopped with -o
This commit is contained in:
Tanmay Naik
2020-07-14 13:11:01 -04:00
parent e639b4814e
commit bb9fbd2ef9
9 changed files with 86 additions and 73 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ func metadataConfig(md *mapstructure.Metadata) viper.DecoderConfigOption {
}
}
func NewRootCmd(configPath string) *cobra.Command {
func NewRootCmd() *cobra.Command {
showVersion := false
config := api.NewConfig()
@@ -97,8 +97,8 @@ func NewRootCmd(configPath string) *cobra.Command {
rootCmd.AddCommand(serveCmd)
rootCmd.AddCommand(gcCmd)
rootCmd.AddCommand(NewConfigCommand(configPath))
rootCmd.AddCommand(NewImageCommand(NewImageSearchService(), configPath))
rootCmd.AddCommand(NewConfigCommand())
rootCmd.AddCommand(NewImageCommand(NewImageSearchService()))
rootCmd.Flags().BoolVarP(&showVersion, "version", "v", false, "show the version and exit")