Closed israel-lugo closed 8 years ago
It would be nice to accept networks from other formats. Jason Iannone asked by email to have "other inputs, including common open ipams, flat texts, MySQL, and radb, or CIDR report integration".
We need to consider how to integrate these formats with the arbitrary syntax of expr
. Perhaps these could just be accepted by the simpler add
and sub
commands, which merely take a list of networks.
Support for this will be tracked in a new ticket.
It turns out that, with the way we're parsing the command arguments right now, it's not trivial to switch from command-line parsing to file parsing mid command. This would be easier if we implement our own parser for the command args, instead of relying on Python's argparse.
For now, it would be much easier to implement something in the following scheme:
$ netcalc add @networks.txt
Where the contents of networks.txt are expanded in-place as though they had been typed on the command-line.
New option to specify networks from file. Ideally, this should work with a consistent syntax for all commands. One idea would be to have to have a global option that tells netcalc to read args from the file. Something like:
Where networks.txt is a list of networks, one per line:
Or, for the
expr
command, which has a more complex syntax:Where expr.txt contains: