karimra / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.kmrd.dev
Apache License 2.0
217 stars 32 forks source link

allow regex in --exclude flag #190

Open karimra opened 4 years ago

karimra commented 4 years ago

Allow regex in --exclude flag, to exclude multiple modules in an easier way. I'm thinking about SRL's --exclude "*-tools*" Do we want/need this ?

neoul commented 4 years ago

@karimra I think there are not many modules to be excluded in my experience. It seems to be over work.

hellt commented 4 years ago

I think its good to have, in SRLinux case for the time being we might have >3 module names that we need to exclude And it seems the additional work for this feature is not really substantial?

What I was thinking as well is to add a file globbing feature for --file flag. The use case is, for example, with Cisco XR/NX models which makes no sense to load altogether (too many different top level modules), but instead it makes sense to load them in feature groups, for example:

gnmic --file vendor/cisco/xr/721/Cisco-IOS-XR*bgp*.yang

will load/read all yang files that are BGP related. This will simplify things a lot in my view

karimra commented 4 years ago

Globbing is different but doable. --exclude takes a module name, while --dir and --file take a file name or a directory that's why this needs regex

EDIT: globs will have to be quoted