xref: /aosp_15_r20/external/shflags/doc/CHANGES-1.0.md (revision 63d4e48fb639f6414be0db9d718e3be2667e4fed)
1*63d4e48fSSadaf Ebrahimi# Changes in shFlags
2*63d4e48fSSadaf Ebrahimi
3*63d4e48fSSadaf Ebrahimi## Changes with 1.0.3
4*63d4e48fSSadaf Ebrahimi
5*63d4e48fSSadaf EbrahimiMAJOR CHANGE! `FLAGS_ARGC` is now obsolete, and is replaced by `FLAGS_ARGV`. See
6*63d4e48fSSadaf Ebrahimibelow for more info.
7*63d4e48fSSadaf Ebrahimi
8*63d4e48fSSadaf EbrahimiFixed issue# 7 where long flags defined with '=' (e.g. `--abc=123`) made it
9*63d4e48fSSadaf Ebrahimiimpossible for the user to know how many non-flag command-line arguments were
10*63d4e48fSSadaf Ebrahimiavailable because the value returned by `FLAGS_ARGC` was wrong. The `FLAGS_ARGC`
11*63d4e48fSSadaf Ebrahimivalue is now obsolete, but will be maintained for backwards compatibility. The
12*63d4e48fSSadaf Ebrahiminew method of getting the non-flag arguments is by executing `eval set --
13*63d4e48fSSadaf Ebrahimi"${FLAGS_ARGV}"` after the `FLAGS` call. The arguments will then be available
14*63d4e48fSSadaf Ebrahimiusing the standard shell $#, $@, $*, $1, etc. variables.
15*63d4e48fSSadaf Ebrahimi
16*63d4e48fSSadaf EbrahimiDue to above fix for issue# 7, there is now proper support for mixing flags with
17*63d4e48fSSadaf Ebrahiminon-flag arguments on the command-line. Previously, all non-flag arguments had
18*63d4e48fSSadaf Ebrahimito be at the end of the command-line.
19*63d4e48fSSadaf Ebrahimi
20*63d4e48fSSadaf EbrahimiRenamed `_flags_standardGetopt()` and `_flags_enhancedGetopt()` functions to
21*63d4e48fSSadaf Ebrahimi`_flags_getoptStandard()` and `_flags_getoptEnhanced()`.
22*63d4e48fSSadaf Ebrahimi
23*63d4e48fSSadaf EbrahimiTook out the setting and restoration of the '-u' shell flag to treat unset
24*63d4e48fSSadaf Ebrahimivariables as an error. No point in having it in this library as it is verified
25*63d4e48fSSadaf Ebrahimiin the unit tests, and provides basically no benefit.
26*63d4e48fSSadaf Ebrahimi
27*63d4e48fSSadaf EbrahimiFixed bug under Solaris where the generated help was adding extra 'x'
28*63d4e48fSSadaf Ebrahimicharacters.
29*63d4e48fSSadaf Ebrahimi
30*63d4e48fSSadaf EbrahimiAdded checks for reserved flag variables (e.g. `FLAGS_TRUE`).
31*63d4e48fSSadaf Ebrahimi
32*63d4e48fSSadaf EbrahimiFixed some unset variable bugs.
33*63d4e48fSSadaf Ebrahimi
34*63d4e48fSSadaf EbrahimiNow report the actual `getopt` error if there is one.
35*63d4e48fSSadaf Ebrahimi
36*63d4e48fSSadaf EbrahimiAll tests now properly enable skipping based on whether a standard or enhanced
37*63d4e48fSSadaf Ebrahimi`getopt` is found.
38*63d4e48fSSadaf Ebrahimi
39*63d4e48fSSadaf EbrahimiAdded the OS version to OS release for Solaris.
40*63d4e48fSSadaf Ebrahimi
41*63d4e48fSSadaf EbrahimiFixed `flags_reset()` so it unsets the default value environment vars.
42*63d4e48fSSadaf Ebrahimi
43*63d4e48fSSadaf Ebrahimi## Changes with 1.0.2
44*63d4e48fSSadaf Ebrahimi
45*63d4e48fSSadaf EbrahimiFLAGS_PARENT no longer transforms into a constant so that it can be defined at
46*63d4e48fSSadaf Ebrahimirun time in scripts.
47*63d4e48fSSadaf Ebrahimi
48*63d4e48fSSadaf EbrahimiAdded warning about short flags being unsupported when there are problems
49*63d4e48fSSadaf Ebrahimiparsing the options with `getopt`.
50*63d4e48fSSadaf Ebrahimi
51*63d4e48fSSadaf EbrahimiAdd default values to end of description strings.
52*63d4e48fSSadaf Ebrahimi
53*63d4e48fSSadaf EbrahimiFixed bug that returned an error instead of success when recalling the default
54*63d4e48fSSadaf Ebrahimivalues for empty strings.
55*63d4e48fSSadaf Ebrahimi
56*63d4e48fSSadaf EbrahimiAdded warning when a duplicate flag definition is attempted.
57*63d4e48fSSadaf Ebrahimi
58*63d4e48fSSadaf EbrahimiImproved `assert[Warn|Error]Msg()` test helper grepping.
59*63d4e48fSSadaf Ebrahimi
60*63d4e48fSSadaf EbrahimiReplaced shell_versions.sh with a new versions library and created
61*63d4e48fSSadaf Ebrahimi`gen_test_results.sh` to make releases easier.
62*63d4e48fSSadaf Ebrahimi
63*63d4e48fSSadaf EbrahimiCopied the coding standards from shUnit2, but haven't fully implemented them in
64*63d4e48fSSadaf EbrahimishFlags yet.
65*63d4e48fSSadaf Ebrahimi
66*63d4e48fSSadaf EbrahimiIssue# 1: When a user defines their own `--help` flag, no more warning is thrown
67*63d4e48fSSadaf Ebrahimiwhen `FLAGS()` is called stating that the help flag already defined.
68*63d4e48fSSadaf Ebrahimi
69*63d4e48fSSadaf EbrahimiIssue# 2: Passing the `--nohelp` option no longer gives help output.
70*63d4e48fSSadaf Ebrahimi
71*63d4e48fSSadaf EbrahimiIssue# 3: Added support for screen width detection.
72*63d4e48fSSadaf Ebrahimi
73*63d4e48fSSadaf Ebrahimi## Changes with 1.0.1
74*63d4e48fSSadaf Ebrahimi
75*63d4e48fSSadaf EbrahimiFixed bug where the help output added '[no]' to all flag names
76*63d4e48fSSadaf Ebrahimi
77*63d4e48fSSadaf EbrahimiAdded additional example files that are referenced by the documentation.
78*63d4e48fSSadaf Ebrahimi
79*63d4e48fSSadaf EbrahimiImproved `zsh` version and option checking.
80*63d4e48fSSadaf Ebrahimi
81*63d4e48fSSadaf EbrahimiUpgraded shUnit2 to 2.1.4
82*63d4e48fSSadaf Ebrahimi
83*63d4e48fSSadaf EbrahimiAdded unit testing for the help output.
84*63d4e48fSSadaf Ebrahimi
85*63d4e48fSSadaf EbrahimiWhen including a library (e.g. shflags) in a script, zsh 3.0.8 doesn't actually
86*63d4e48fSSadaf Ebrahimiexecute the code in-line, but later. As such, variables that are defined in the
87*63d4e48fSSadaf Ebrahimilibrary cannot be used until functions are called from the main code. This
88*63d4e48fSSadaf Ebrahimirequired the 'help' flag definition to be moved inside the FLAGS command.
89*63d4e48fSSadaf Ebrahimi
90*63d4e48fSSadaf Ebrahimi## Changes with 1.0.0
91*63d4e48fSSadaf Ebrahimi
92*63d4e48fSSadaf EbrahimiThis is the first official release, so everything is new.
93