-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathAnnotations.scala
62 lines (50 loc) · 1.53 KB
/
Annotations.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package caseapp
import scala.annotation.StaticAnnotation
/**
* Extra name for the annotated argument
*/
final case class Name(name: String) extends StaticAnnotation
/**
* Description of the value of the annotated argument
*/
final class ValueDescription(val description: String) extends StaticAnnotation {
def message: String = s"<$description>"
}
object ValueDescription {
val default = new ValueDescription("value")
}
/**
* Help message for the annotated argument
*/
final class HelpMessage(val message: String) extends StaticAnnotation
/**
* Name for the annotated case class of arguments
* E.g. MyApp
*/
final class AppName(val appName: String) extends StaticAnnotation
/**
* Program name for the annotated case class of arguments
* E.g. my-app
*/
final class ProgName(val progName: String) extends StaticAnnotation
/**
* Set the command name of the annotated case class of arguments
* E.g. my-app
*/
final class CommandName(val commandName: String) extends StaticAnnotation
/**
* App version for the annotated case class of arguments
*/
final class AppVersion(val appVersion: String) extends StaticAnnotation
/**
* Name for the extra arguments of the annotated case class of arguments
*/
final class ArgsName(val argsName: String) extends StaticAnnotation
/**
* Don't parse the annotated field as a single argument. Recurse on its fields instead.
*/
final class Recurse extends StaticAnnotation
/**
* Do not include this field / argument in the help message
*/
final class Hidden extends StaticAnnotation