Chapter 5. Short vs. Long Flags
Prev |  | Next

## Chapter 5. Short vs. Long Flags

`Switch`es, `FlaggedOption`s, and `QualifiedSwitch`es all require flags. Flags can be short, consisting of a single character and preceded by a single hyphen, or long, consisting of more than one character and preceded by two hyphens. `Switch`es, `FlaggedOption`s, and `QualifiedSwitch`es may use short flags, long flags, or both.

In general, your program's most commonly used options should have short flags. Long flags are generally more appropriate for less-frequently used options.

In order to configure a parameter with no short flag, specify a short flag equal to `JSAP.NO_SHORTFLAG`. In order to configure a parameter with no long flag, specify a long flag equal to `JSAP.NO_LONGFLAG`.

Prev |  | Next
Using the JSAPResult | Home | Chapter 6. Switches