This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various fixes for usages derived from the
@arg
annotation.
Enforce if both 'flag' and 'name' are given in the `@arg` annotation, the length of 'flag' is less than or equal to the length of 'name'. It is ok if the length of 'name' derived from the constructor-parameter/field is less than the length of 'flag', and in this cause we'll print 'flag' second. Examples: 1. `@arg(flag="abc", name="a") val a: T` should be illegal 2. `@arg(flag="abc") val a: T` will have usage "-a T, --abc=T" Previously it would not check and print the following usages for 1-2 above: 1. "-abc T, --a=T". Note that specifying either "-abc T" or "--a T" wouldn't work. 2. "-abc T, -a=T". Note that specifying "-abc T" wouldn't work. Format a single-character flag correctly if specified in name or the variable/field is a single-character. - `@arg(name="a") val abc: T` will have usage "-a T". - `@arg val a: T` will have usage "-a T". Add a regression test for the 'name' field being camel case: - `@arg(name="aB") val a: T` will have usage "--aB=T". Fix the usage for multi-character flag arguments. For example, if `@arg(flag="abc") val abcd: T` then the usage will be "--abc=T, --abcd=T"; it was previously "-abc T, --abcd=T". Updated the documentation for ArgAnnotation for all the above.
- Loading branch information
Showing
4 changed files
with
153 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters