projectdiscovery / mapcidr

Utility program to perform multiple operations for a given subnet/CIDR ranges.
https://projectdiscovery.io
MIT License
977 stars 91 forks source link

Add ability to comment input and strip before parsing #472

Closed ddfault closed 1 week ago

ddfault commented 1 month ago

Hello! Fixed some typos. I am using source files where I want to comment IP/CIDR so I know what or where something came from. Added a integration test with some comments. Example input such as:

commentexample.txt

127.0.0.2 # This is another loopback address
127.0.0.1   #another comment with more spaces
127.0.0.3#another comment with no space between 

Usage: mapcidr.exe -cl commentexample.txt -a

Or 127.0.0.1 #comment 1,127.0.0.2 # another comment, 127.0.0.3#comment with no space Usage: mapcidr.exe -cl "127.0.0.1 #comment 1,127.0.0.2 # another comment, 127.0.0.3#comment with no space"

GeorginaReeder commented 1 month ago

Great, thank you for your contribution @ddfault !

ddfault commented 1 month ago

Not a problem. Is this good to go or do you need more from me on this pull request? I believe the errors in Build tests are unrelated to my code changes.