Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing command line (copied from sf) #13

Open
lexicalscope opened this issue Feb 26, 2012 · 0 comments
Open

Error parsing command line (copied from sf) #13

lexicalscope opened this issue Feb 26, 2012 · 0 comments

Comments

@lexicalscope
Copy link
Owner

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 <ipv4, ipv6>
--gateway -g /\d{1,3}+.\d{1,3}+.\d{1,3}+.\d{1,3}+/ : gateway ip address
--mode -m value : modes <STATIC, DHCP, LOOPBACK>
--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 <STATIC, DHCP, LOOPBACK>")
InterfaceMode getMode();

@option(shortName = "f", description = "ip address family <ipv4, ipv6>", 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant