forked from argparse4j/argparse4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NEWS
141 lines (102 loc) · 5.21 KB
/
NEWS
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
argparse4j 0.8.0
================
Release Note
------------
New features have been added, and things have been improved on a lot
of fronts. See below.
The Maven build has been modified to allow for extension modules. All
plug-ins have been upgraded too. CI builds are running on Travis CI
now.
Multiple differently-configured parsers can now be used at the same
time without interfering with each other. Client code that adds
arguments to an argument container can be made reusable.
Optional arguments are now called named arguments. Arguments not given
by the user can be suppressed in the resulting namespace. Case-
insensitive enum argument types have been improved and extended.
The exit code will no longer indicate an error if the user requests
help. The help text can be written to a destination other than
standard output. Help can be suppressed for arguments and sub parsers.
Parsers can be configured to use a locale other than the default.
Dutch and Russian translations have been added. CJK character widths
have been updated.
Java 7 and Hadoop support has been added using extension modules. Both
introduce a new argument type.
If you, or a project you use, implement "ArgumentParser" or
"Subparser", you may run into run time issues when you upgrade.
Changes
-------
Infrastructure
* The project has been restructured to allow for extension modules.
Extension modules can add support for newer JDKs and external APIs
without introducing JDK requirements or dependencies in the main
module.
* The Maven plug-ins have been upgraded to latest versions.
* A CI build is now running for all commits on Travis CI. The build
detects the use of classes of SDKs newer than the one we support.
See: https://travis-ci.org/tatsuhiro-t/argparse4j
* Paths of IntelliJ IDEA have been added to the Git ignore list.
Parsers
* A new way to create parsers was introduced to allow for multiple,
simultaneously-used parser instances with different configurations
without interfering with each other. See
"ArgumentParsers.newFor(String)".
* Arguments can be added to "ArgumentGroup",
"MutuallyExclusiveArgumentGroup" and "ArgumentParser". Interface
"ArgumentContainer" was introduced to allow code adding arguments to
one of these to be reused for all of them.
Arguments
* Optional arguments (which could be configured to be required) have
been renamed to "named arguments".
* Added (optional) suppression of key with value "null" in the
namespace for arguments not present on the command line. See
"Argument.setDefault(FeatureControl)".
* Case-insensitive enum matching has been fixed. It now uses the root
locale for deterministic conversion of characters to lower case. You
have to switch to "CaseInsensitiveEnumNameArgumentType" to make use
of the improved implementation. "CaseInsensitiveEnumArgumentType"
behaves like before, but its constructor has been deprecated. See
"Arguments.caseInsensitiveEnumType(Class<T>)".
* A variant of case-insensitive enum matching has been added that uses
"toString()" instead of "name()" for the enum value. See
"Arguments.caseInsensitiveEnumStringType(Class<T>)".
* Customized conversion of an enum to a value is now possible by
creating a sub class of "CaseInsensitiveEnumArgumentType". See the
existing sub classes for an example.
* It is now possible to specify multiple verification groups for "File"
(and Java 7 "Path") types. If at least one group is verified
successfully, the argument is accepted. This is useful for
applications that can create the missing file or directory
themselves.
Help
* If you use "ArgumentParser.parseArgsOrFail(String[])" or
"ArgumentParser.parseKnownArgsOrFail(String[], List<String>)", and
the user requests help, the exit code will be 0 instead of 1 now.
* It is now possible to write the help text to a specific
"PrintWriter" instead of standard output. See
"ArgumentParser.printHelp(PrintWriter)".
* Added (optional) suppression of help for arguments and sub parsers.
See "Argument.help(FeatureControl)" and
"Subparser.help(FeatureControl)".
Internationalization
* Added a feature to create a parser that uses a locale other than the
default of the JVM. See "ArgumentParserBuilder.locale(Locale)".
* Added Dutch and Russian translations.
* All user messages have been localized. argparse4j is available in
Dutch, English, German and Russian.
* The CJK character widths have been updated to Unicode 10.
Extension modules
* An extension module for Java 7 has been added. It contains the
following features:
* An argument type for "java.nio.file.Path".
* An extension module for Hadoop has been added. It contains the
following features:
* An argument type for "org.apache.hadoop.fs.Path".
Backward compatibility
* Methods have been added to interfaces "ArgumentParser" and
"Subparser". Classes implementing these interfaces must be updated
and recompiled. If you use existing binary artifacts containing
classes implementing these interfaces, and you upgrade argparse4j, a
"NoSuchMethodError" will be thrown if one of these new methods is
invoked. These interfaces were not meant to be implemented by client
code, so there should be very few, if any, custom implementations.
The chances of running into problems should be very slim.