made example current
This commit is contained in:
parent
6f01a1287b
commit
7d0aad767e
|
@ -8,26 +8,27 @@ public class Example {
|
||||||
CmdOptions.i().createOption("name").// give the option a name which you
|
CmdOptions.i().createOption("name").// give the option a name which you
|
||||||
// can
|
// can
|
||||||
// remember within your project
|
// remember within your project
|
||||||
addCommand("--name") // it's always good to define a long
|
addLongCommand("--name"). // it's always good to define a
|
||||||
// commandline parameter with a
|
// long
|
||||||
// describing name
|
// commandline parameter with a
|
||||||
|
// describing name
|
||||||
|
|
||||||
.addCommand("-n") // of course, programmer are always lazy so
|
addCommand("-n"). // of course, programmer are always lazy so
|
||||||
// give them an possibility to shortcut your
|
// give them an possibility to shortcut your
|
||||||
// option
|
// option
|
||||||
.addDefaultParameter("whatever")// a default parameter is good
|
addDefaultParameter("whatever").// a default parameter is good
|
||||||
// if you need the option within
|
// if you need the option within
|
||||||
// your program, but don't care
|
// your program, but don't care
|
||||||
// when it's omitted on
|
// when it's omitted on
|
||||||
// execution
|
// execution
|
||||||
.setDescription("an example option.");// And of course a
|
setDescription("an example option.");// And of course a
|
||||||
// description... for
|
// description... for
|
||||||
// the help readers, the
|
// the help readers, the
|
||||||
// few among us...
|
// few among us...
|
||||||
CmdOptions
|
CmdOptions
|
||||||
.i()
|
.i()
|
||||||
.createOption("complex")
|
.createOption("complex")
|
||||||
.addCommand("--complex")
|
.addLongCommand("--complex")
|
||||||
// see above
|
// see above
|
||||||
// yes you can omit a default parameter, but you have to
|
// yes you can omit a default parameter, but you have to
|
||||||
// check later in your project if that option is set.
|
// check later in your project if that option is set.
|
||||||
|
@ -42,7 +43,7 @@ public class Example {
|
||||||
// here you are able to add some more alternatives for that
|
// here you are able to add some more alternatives for that
|
||||||
// option, so here you can use "--complex", "-c", "-i" and
|
// option, so here you can use "--complex", "-c", "-i" and
|
||||||
// "--ccp" to trigger this option.
|
// "--ccp" to trigger this option.
|
||||||
.addCommand("-i").addCommand("--ccp");
|
.addCommand("-i").addLongCommand("--ccp");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue