subscribe cmd: change path to StringArray
@@ -168,7 +168,7 @@ func init() {
rootCmd.AddCommand(subscribeCmd)
subscribeCmd.SilenceUsage = true
subscribeCmd.Flags().StringP("prefix", "", "", "subscribe request prefix")
- subscribeCmd.Flags().StringSliceP("path", "", []string{""}, "subscribe request paths")
+ subscribeCmd.Flags().StringArrayVarP(&paths, "path", "", []string{""}, "subscribe request paths")
//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")
@@ -184,7 +184,6 @@ func init() {
subscribeCmd.Flags().StringSliceP("name", "n", []string{}, "reference subscriptions by name, must be defined in gnmic config file")
//
viper.BindPFlag("subscribe-prefix", subscribeCmd.LocalFlags().Lookup("prefix"))
- 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-mode", subscribeCmd.LocalFlags().Lookup("mode"))
@@ -250,7 +249,6 @@ func getOutputs() (map[string][]outputs.Output, error) {
func getSubscriptions() (map[string]*collector.SubscriptionConfig, error) {
subscriptions := make(map[string]*collector.SubscriptionConfig)
- paths := viper.GetStringSlice("subscribe-path")
hi := viper.GetDuration("subscribe-heartbeat-interval")
si := viper.GetDuration("subscribe-sample-interval")
qos := viper.GetUint32("subscribe-qos")
