aligned sub cmd flag names
@@ -194,8 +194,8 @@ func init() {
//subscribeCmd.MarkFlagRequired("path")
subscribeCmd.Flags().Int32P("qos", "q", 20, "qos marking")
subscribeCmd.Flags().BoolP("updates-only", "", false, "only updates to current state should be sent")
- subscribeCmd.Flags().StringP("subscription-mode", "", "stream", "one of: once, stream, poll")
- subscribeCmd.Flags().StringP("stream-subscription-mode", "", "target-defined", "one of: on-change, sample, target-defined")
+ subscribeCmd.Flags().StringP("mode", "", "stream", "one of: once, stream, poll")
+ subscribeCmd.Flags().StringP("stream-mode", "", "target-defined", "one of: on-change, sample, target-defined")
subscribeCmd.Flags().StringP("sample-interval", "i", "10s",
"sample interval as a decimal number and a suffix unit, such as \"10s\" or \"1m30s\", minimum is 1s")
subscribeCmd.Flags().BoolP("suppress-redundant", "", false, "suppress redundant update if the subscribed value didn't not change")
@@ -207,8 +207,8 @@ func init() {
viper.BindPFlag("subscribe-path", subscribeCmd.LocalFlags().Lookup("path"))
viper.BindPFlag("subscribe-qos", subscribeCmd.LocalFlags().Lookup("qos"))
viper.BindPFlag("subscribe-updates-only", subscribeCmd.LocalFlags().Lookup("updates-only"))
- viper.BindPFlag("subscribe-subscription-mode", subscribeCmd.LocalFlags().Lookup("subscription-mode"))
- viper.BindPFlag("subscribe-stream-subscription-mode", subscribeCmd.LocalFlags().Lookup("stream-subscription-mode"))
+ viper.BindPFlag("subscribe-mode", subscribeCmd.LocalFlags().Lookup("mode"))
+ viper.BindPFlag("subscribe-stream-mode", subscribeCmd.LocalFlags().Lookup("stream-mode"))
viper.BindPFlag("subscribe-sample-interval", subscribeCmd.LocalFlags().Lookup("sample-interval"))
viper.BindPFlag("subscribe-suppress-redundant", subscribeCmd.LocalFlags().Lookup("suppress-redundant"))
viper.BindPFlag("subscribe-heartbeat-interval", subscribeCmd.LocalFlags().Lookup("heartbeat-interval"))
@@ -323,10 +323,10 @@ func getSubscriptions() (map[string]*collector.SubscriptionConfig, error) {
sub.Name = "default"
sub.Paths = paths
sub.Prefix = viper.GetString("subscribe-prefix")
- sub.Mode = viper.GetString("subscribe-subscription-mode")
+ sub.Mode = viper.GetString("subscribe-mode")
sub.Encoding = viper.GetString("encoding")
sub.Qos = viper.GetUint32("qos")
- sub.StreamMode = viper.GetString("subscribe-stream-subscription-mode")
+ sub.StreamMode = viper.GetString("subscribe-stream-mode")
sub.HeartbeatInterval = viper.GetDuration("subscribe-heartbeat-interval")
sub.SampleInterval = viper.GetDuration("subscribe-sample-interval")
sub.SuppressRedundant = viper.GetBool("subscribe-suppress-redundant")
