@@ -24,12 +24,12 @@ package scala.annotation
2424 * object foo {
2525 * def main(args: Array[String]): Unit = {
2626 * val mainAnnot = new myMain()
27- * val info = new CommandInfo (
27+ * val info = new Info (
2828 * name = "foo.main",
2929 * documentation = "Sum all the numbers",
3030 * parameters = Seq(
31- * new ParameterInfo ("first", "scala.Int", hasDefault=false, isVarargs=false, "Fist number to sum"),
32- * new ParameterInfo ("rest", "scala.Int" , hasDefault=false, isVarargs=true, "The rest of the numbers to sum")
31+ * new Parameter ("first", "scala.Int", hasDefault=false, isVarargs=false, "Fist number to sum"),
32+ * new Parameter ("rest", "scala.Int" , hasDefault=false, isVarargs=true, "The rest of the numbers to sum")
3333 * )
3434 * )
3535 * val mainArgsOpt = mainAnnot.command(info, args)
@@ -49,7 +49,7 @@ package scala.annotation
4949 */
5050@ experimental
5151trait MainAnnotation [Parser [_], Result ] extends StaticAnnotation :
52- import MainAnnotation .{CommandInfo , ParameterInfo }
52+ import MainAnnotation .{Info , Parameter }
5353
5454 /** Process the command arguments before parsing them.
5555 *
@@ -62,17 +62,17 @@ trait MainAnnotation[Parser[_], Result] extends StaticAnnotation:
6262 * @param info The information about the command (name, documentation and info about parameters)
6363 * @param args The command line arguments
6464 */
65- def command (info : CommandInfo , args : Seq [String ]): Option [Seq [String ]]
65+ def command (info : Info , args : Seq [String ]): Option [Seq [String ]]
6666
6767 /** The getter for the `idx`th argument of type `T`
6868 *
6969 * @param idx The index of the argument
7070 * @param defaultArgument Optional lambda to instantiate the default argument
7171 */
72- def argGetter [T ](param : ParameterInfo , arg : String , defaultArgument : Option [() => T ])(using Parser [T ]): () => T
72+ def argGetter [T ](param : Parameter , arg : String , defaultArgument : Option [() => T ])(using Parser [T ]): () => T
7373
7474 /** The getter for a final varargs argument of type `T*` */
75- def varargGetter [T ](param : ParameterInfo , args : Seq [String ])(using Parser [T ]): () => Seq [T ]
75+ def varargGetter [T ](param : Parameter , args : Seq [String ])(using Parser [T ]): () => Seq [T ]
7676
7777 /** Run `program` if all arguments are valid if all arguments are valid
7878 *
@@ -88,19 +88,19 @@ object MainAnnotation:
8888 /** Information about the main method
8989 *
9090 * @param name The name of the main method
91- * @param documentation The documentation of the main method without the `@param` documentation (see ParameterInfo .documentaion)
91+ * @param documentation The documentation of the main method without the `@param` documentation (see Parameter .documentaion)
9292 * @param parameters Information about the parameters of the main method
9393 */
94- final class CommandInfo (
94+ final class Info (
9595 val name : String ,
9696 val documentation : String ,
97- val parameters : Seq [ParameterInfo ],
97+ val parameters : Seq [Parameter ],
9898 ):
9999
100100 /** If the method ends with a varargs parameter */
101101 def hasVarargs : Boolean = parameters.nonEmpty && parameters.last.isVarargs
102102
103- end CommandInfo
103+ end Info
104104
105105 /** Information about a parameter of a main method
106106 *
@@ -111,7 +111,7 @@ object MainAnnotation:
111111 * @param documentation The documentation of the parameter (from `@param` documentation in the main method)
112112 * @param annotations The annotations of the parameter that extend `ParameterAnnotation`
113113 */
114- final class ParameterInfo (
114+ final class Parameter (
115115 val name : String ,
116116 val typeName : String ,
117117 val hasDefault : Boolean ,
@@ -120,7 +120,7 @@ object MainAnnotation:
120120 val annotations : Seq [ParameterAnnotation ],
121121 )
122122
123- /** Marker trait for annotations that will be included in the ParameterInfo annotations. */
123+ /** Marker trait for annotations that will be included in the Parameter annotations. */
124124 trait ParameterAnnotation extends StaticAnnotation
125125
126126end MainAnnotation
0 commit comments