You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/annotations/command.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -59,5 +59,8 @@ public class Tool { }
59
59
60
60
Here we add our command to the `common` group, we also add it to the `bar` group which is a sub-group of the `foo` group.
61
61
62
-
Note that since command and group names cannot contain whitespace **any** whitespace in the specified group names is interpreted as a separator and thus treated as a path to the actual group you want to place your command in.
62
+
Note that since command and group names cannot contain whitespace **any** whitespace in the specified group names is interpreted as a separator and thus treated as a path to the actual group you want to place your command in.
63
+
64
+
{% include alert.html %}
65
+
You can also specify groups by using the [`@Group`](group.html) annotation or as part of the [`@Cli`](cli.html) annotation.
Copy file name to clipboardExpand all lines: guide/annotations/discussion.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -18,4 +18,4 @@ To add a discussion section simply add the `@Discussion` annotated to a class li
18
18
"We can have as many paragraphs as we feel are necessary"})
19
19
publicclassMyClass { }```
20
20
21
-
The annotation takes a single `paragraphs` field which takes a `String[]` array where each entry in the array is treated as a separate paragraph.
21
+
The annotation takes a single `paragraphs` field which takes a `String[]` array where each entry in the array is treated as a separate paragraph of discussion in the help output.
Copy file name to clipboardExpand all lines: guide/annotations/group.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,6 @@ title: Group Annotation
5
5
6
6
## `@Group`
7
7
8
-
The `@Group` annotation is used to specify group information. This may be done as an alternative or in addition to using the relevant fields of the [`@Command`](command.html) or [`@Cli`](cli.html) annotations to specify groups.
8
+
The `@Group` annotation is used to specify group information. This may be done as an alternative or in addition to using the relevant fields of the [`@Command`](command.html) or [`@Cli`](cli.html) annotations to specify groups.
Copy file name to clipboardExpand all lines: guide/annotations/index.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The following annotations are used to define the high level aspects of your CLIs
15
15
- The [`@Option`](option.html) annotation defines fields of a class as denoting options
16
16
- The [`@Arguments`](arguments.html) annotation defines a field of a class as denoting arguments
17
17
- The [`@Cli`](cli.html) annotation defines a class as being a CLI which consists of potentially many commands
18
+
- The [`@Group`](group.html) annotation defines a command group within a CLI
18
19
- The [`@Parser`](parser.html) annotation defines the parser behaviour
19
20
- The [`@DefaultOption`](default-option.html) annotation defines an `@Option` annotated field as being able to also be populated as if it were `@Arguments` annotated
20
21
@@ -28,4 +29,6 @@ The following annotations are used to define various restrictions on options and
28
29
29
30
The following annotations are used to add additional help information to commands that may be consumed by the various help generators provided by Airline.
30
31
31
-
**TODO** - List help annotations
32
+
**TODO** - List help annotations
33
+
34
+
- The [`@Discussion`](discussion.html) annotation adds extended discussion to an [`@Command`](command.html) annotated class
Copy file name to clipboardExpand all lines: guide/annotations/parser.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,8 @@ title: Parser Annotation
5
5
6
6
## `@Parser`
7
7
8
-
The `@Parser` annotation is applied to classes also annotated with `@Command` to configure the parser behaviour for that single command. It may also be used as an argument to the `@Cli` annotation (see the [CLI Annotation](cli.html) documentation) in order to configure parser behaviour for a CLI.
8
+
The `@Parser` annotation is applied to classes also annotated with `@Command` to configure the parser behaviour for that single command when parsers are created using `SingleCommand.singleCommand()`.
9
+
10
+
It may also be used as an argument to the [`@Cli`](cli.html) annotation in order to configure parser behaviour for a CLI.
Copy file name to clipboardExpand all lines: guide/index.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,8 @@ For a more complex CLI we need to use the [`@Cli`](annotations/cli.html) annotat
200
200
commands= { GettingStarted.class, Tool.class })
201
201
```
202
202
203
-
This states that our CLI has a `name` of `basic` and that it consists of two commands - `GettingStarted.class` and `Tool.class`.Each command itself needs to be appropriately defined with at minimum an `@Command` annotation as shown in the earlier `GettingStarted.java` example.
203
+
This states that our CLI has a `name` of `basic` and that it consists of two commands - `GettingStarted.class` and `Tool.class`.Each command itself needs to be appropriately defined with at minimum a `@Command` annotation as shown in the earlier `GettingStarted.java` example.
204
204
205
205
We also specify that `GettingStarted.class` will serve as our `defaultCommand`, this specifies what the behaviour of our CLI is if a user does not explicitly provide the name of the command to be run.
Copy file name to clipboardExpand all lines: guide/parser/index.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,4 +3,6 @@ layout: page
3
3
title: Parsing
4
4
---
5
5
6
-
The core of Airline is its parser which takes in string arguments passed into the JVM and turns that into a command instance with appropriately populated fields that your code can then use to actually run its intended function.
6
+
The core of Airline is its parser which takes in string arguments passed into the JVM and turns that into a command instance with appropriately populated fields that your code can then use to actually run its intended function.
Copy file name to clipboardExpand all lines: guide/practise/types.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,4 +40,8 @@ More generally Airline supports any Java class that meets one of the following c
40
40
41
41
Airline also supports any type which is a `Collection` of another supported type.
42
42
43
-
The advantage of using collection types e.g. `List<String>` is that your `@Option` or `@Arguments` annotated field stores all the values passed in. If your field has a non-collection type then only the last use of that option/argument will be stored in the final class that Airline creates.
43
+
The advantage of using collection types e.g. `List<String>` is that your `@Option` or `@Arguments` annotated field stores all the values passed in. If your field has a non-collection type then only the last use of that option/argument will be stored in the final class that Airline creates.
Copy file name to clipboardExpand all lines: guide/restrictions/index.md
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,20 @@ layout: page
3
3
title: Restrictions
4
4
---
5
5
6
-
Airline includes a powerful and extensible restrictions system that allows users to significantly reduce the boiler plate code typical of many CLI libraries. Restrictions work by simply applying appropriate annotations to the `@Option` or `@Arguments` annotated fields that you wish to restrict and Airline handles all the work of enforcing those restrictions for you.
6
+
Airline includes a powerful and extensible restrictions system that allows users to significantly reduce the boiler plate code typical of many CLI libraries. Restrictions work by simply applying appropriate annotations to the [`@Option`](../annotations/option.html) or [`@Arguments`](../annotations/arguments.html) annotated fields that you wish to restrict and Airline handles all the work of enforcing those restrictions for you.
0 commit comments