@@ -107,13 +107,15 @@ class ArgParser(args: Array<out String>,
107107 /* *
108108 * Creates a Delegate for a single-argument option that stores and returns the option's argument.
109109 */
110- fun storing (vararg names : String , help : String ): Delegate <String > =
111- storing(* names, help = help) { this }
110+ fun storing (vararg names : String , help : String , argName : String? = null ): Delegate <String > =
111+ storing(* names, help = help, argName = argName ) { this }
112112
113113 /* *
114114 * Creates a DelegateProvider for a single-argument option that stores and returns the option's argument.
115115 */
116- fun storing (help : String ) = DelegateProvider { identifier -> storing(identifierToOptionName(identifier), help = help) }
116+ fun storing (help : String , argName : String? = null) =
117+ DelegateProvider { identifier ->
118+ storing(identifierToOptionName(identifier), help = help, argName = argName) }
117119
118120 /* *
119121 * Creates a Delegate for a single-argument option that adds the option's (transformed) argument to a
@@ -167,16 +169,17 @@ class ArgParser(args: Array<out String>,
167169 */
168170 fun <T > adding (
169171 help : String ,
172+ argName : String? = null,
170173 transform : String .() -> T
171174 ) = DelegateProvider { identifier ->
172- adding(identifierToOptionName(identifier), help = help, transform = transform) }
175+ adding(identifierToOptionName(identifier), help = help, argName = argName, transform = transform) }
173176
174177 /* *
175178 * Creates a Delegate for a single-argument option that adds the option's argument to a MutableList each time the
176179 * option appears in args, and returns said MutableCollection.
177180 */
178- fun adding (vararg names : String , help : String ): Delegate <MutableList <String >> =
179- adding(* names, help = help) { this }
181+ fun adding (vararg names : String , help : String , argName : String? = null ): Delegate <MutableList <String >> =
182+ adding(* names, help = help, argName = argName ) { this }
180183
181184 /* *
182185 * Creates a DelegateProvider for a single-argument option that adds the option's argument to a MutableList each time the
0 commit comments