Sdlcli get -command writes wrongly results to stderr stream. Fix sdlcli
get -command to write results to stdout stream when command execution
has succeeded. In addition add similar stdout redirect also to sdlcli
statistics -command just to keep the code look the same, even thought
there wasn't any real issue with sdlcli statistics -command's results
visibility.
Version: 0.9.3
Issue-Id: RIC-873
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Icc7d42d9200bdcc74bf1da6ceab341dd6b69c16e
Version history
---------------
+[0.9.3] - 2021-12-30
+
+* Fix SDL CLI get -command to write results stdout stream when command success
+
[0.9.2] - 2021-12-22
* Fix SDL CLI healthcheck to ignore ghost Redis Sentinel entries
)
func newGetCmd(sdlCb SyncStorageCreateCb) *cobra.Command {
- return &cobra.Command{
+ cmd := &cobra.Command{
Use: "get <namespace> <key> [<key2> <key3>... <keyN>]",
Short: "Display one or many resources",
Long: getLong,
return nil
},
}
+ cmd.SetOut(os.Stdout)
+ return cmd
}
func runGet(sdlCb SyncStorageCreateCb, args []string) (map[string]interface{}, error) {
)
func newKeysCmd(sdlCb SyncStorageCreateCb) *cobra.Command {
- return &cobra.Command{
+ cmd := &cobra.Command{
Use: "keys <namespace> [pattern|default '*']",
Short: "List keys in the given namespace matching key search pattern",
Long: keysLong,
return nil
},
}
+ cmd.SetOut(os.Stdout)
+ return cmd
}
func runListKeys(sdlCb SyncStorageCreateCb, args keysArgs) ([]string, error) {
)
func newStatisticsCmd(dbCreateCb DbCreateCb) *cobra.Command {
- return &cobra.Command{
+ cmd := &cobra.Command{
Use: "statistics",
Short: "Display statistics.",
Long: statsLong,
return nil
},
}
+ cmd.SetOut(os.Stdout)
+ return cmd
}
func runStats(dbCreateCb DbCreateCb) ([]*sdlgoredis.DbStatistics, error) {