401 |
402 | @Option |
403 | Specifies that the annotated method represents an option |
404 |
405 |
406 | @LongSwitch(switchname) |
407 | Specifies the long switch used to give this option on the command line |
408 |
409 |
410 | @ShortSwitch(switchname) |
411 | Specifies the short switch used to give this option on the command line |
412 |
413 |
414 | @LooseArguments |
415 | Specifies that this setter handles arguments that are not connected to an option |
416 |
417 |
418 | @Toggle(value) |
419 | Specifies that this option is a toggle. The boolean argument is passed directly to the setter method |
420 |
421 |
422 | @SingleArgument |
423 | Specifies that this option takes a single String argument |
424 |
425 |
426 | @AllAvailableArguments |
427 | Specifies that this option takes all the argument available until the next switch or end of the argument
428 | list
429 | |
430 |
431 |
432 | @ArgumentsUntilDelimiter(delimiter) |
433 | Specifies that the option takes all arguments available until it encounters the delimiter or the end of the
434 | argument list. Any switches will be interpreted as regular options
435 | |
436 |
437 |
438 | @SubConfiguration(class) |
439 | Specifies that parsing should continue based on the specified class. When that parsing is finnished, parsing
440 | will resume for the main configuration
441 | |
442 |
443 |
444 | @Multiple |
445 | Specifies that the option might occur multiple times
446 | |
447 |
448 | #### Rules ####
449 |
450 | * @Option must be specifies for all methods that should be processed
451 | * For regular options, one of @LongSwitch and @ShortSwitch must be specified, but it's not required to specify
452 | both
453 | * if @LooseArguments is specified, @ShortSwitch and @LongSwitch cannot be specified
454 | * For switches, one of @Toggle, @SingleArgument, @AllAvailableArguments, @ArgumentsUntilDelimiter or
455 | @SubConfiguration must be specified
456 | * @Multiple can be specified for all option types, including loose arguments
457 | * @LongSwitch and @ShortSwitch must be given without leading dashes.
458 |
459 | #### Types ####
460 |
461 | * Toggles require the setter argument to be boolean
462 | * Single arguments require the setter argument to be a String
463 | * Multiple arguments require the setter argument to be a List