lexicalscope/jewelcli — Issue #13: Error parsing command line (copied from sf)
Author: lexicalscope
Created: 2012-02-26 13:14:59+00:00
State: open

Command line: interface --mode STATIC --family ipv4 --mask 255.255.0.0 --gateway 10.77.1.4 --address 10.77.111.179 eth0
Use case: eth0 must be the interface name
Help:
Usage: interface options
--address -a /\d{1,3}+.\d{1,3}+.\d{1,3}+.\d{1,3}+/ : interface ip address
--family -f value : ip address family
--gateway -g /\d{1,3}+.\d{1,3}+.\d{1,3}+.\d{1,3}+/ : gateway ip address
--mode -m value : modes
--netmask -n /\d{1,3}+.\d{1,3}+.\d{1,3}+.\d{1,3}+/ : ip address net mask
Java interface:
@CommandLineInterface(application = "interface")
public interface InterfaceCommand {
@Option(shortName = "m", description = "modes ")
InterfaceMode getMode();

@Option(shortName = "f", description = "ip address family ", defaultValue = "ipv4")
IPAddressFamily getFamily();

@Option(shortName = "n", description = "ip address net mask", pattern = "\\d{1,3}+.\\d{1,3}+.\\d{1,3}+.\\d{1,3}+", defaultValue = "255.255.255.0")
String getNetmask();

@Option(shortName = "g", description = "gateway ip address", pattern = "\\d{1,3}+.\\d{1,3}+.\\d{1,3}+.\\d{1,3}+", defaultValue = "127.0.0.1")
String getGateway();

@Option(shortName = "a", description = "interface ip address", pattern = "\\d{1,3}+.\\d{1,3}+.\\d{1,3}+.\\d{1,3}+", defaultValue = "127.0.0.1")
String getAddress();

//@Option(shortName = "i", description = "interface name")
@Unparsed(name = "")
String getInterface();

enum IPAddressFamily {
ipv4, ipv6
}

enum InterfaceMode {
STATIC, DHCP, LOOPBACK
}
}
Error: Option does not take a value: uk.co.flamingpenguin.jewel.cli.UnparsedSpecificationImpl@4b222f