snar / bgpq3

bgpq3
BSD 2-Clause "Simplified" License
362 stars 53 forks source link

Add -1 (raw mode) to just print raw prefix-list. #31

Closed dotwaffle closed 7 years ago

dotwaffle commented 7 years ago

At present, the only ways to get a prefix list without any formatting are to either use JSON output and pipe through "jq" or similar, or to generate a normal Cisco IOS prefix list and "cut" the fifth field, or to use a user-defined format of "-F '%n/%l\n'" which isn't so intuitive.

In order to make the lives of those who just want prefix lists easier, I've added the "-1" option, which prints one prefix per line. I've called it "raw" mode, but I imagine there is probably a better name for it that I'll be very happy for it to change to!

dotwaffle commented 7 years ago

Have fixed conflicts due to changes made for Nokia.

snar commented 7 years ago

This patch is rejected. Two reasons: a) I do not like the idea. As you already stated, it is just syntax sugar for -F "%n/%l\n" and nothing more. b) I do not like implementation, which is horrible :(

dotwaffle commented 7 years ago

I disagree with not liking the idea, there are many output formats already, just not one that only outputs an actual list of prefixes rather than formatted for a particular router configuration style.

I don't quite understand why you don't like the implementation, it's pretty much copy/paste of how other styles were implemented.

Either way, ok. I can live with this.