netcmd: add optparse validators and Range validator