1*63d4e48fSSadaf Ebrahimi# Changes in shFlags 2*63d4e48fSSadaf Ebrahimi 3*63d4e48fSSadaf Ebrahimi## Changes with 1.2.3 4*63d4e48fSSadaf Ebrahimi 5*63d4e48fSSadaf EbrahimiUpgraded shUnit2 to 2.1.7. 6*63d4e48fSSadaf Ebrahimi 7*63d4e48fSSadaf EbrahimiFixed the examples to work again with the new code structure. 8*63d4e48fSSadaf Ebrahimi 9*63d4e48fSSadaf EbrahimiRemoved `gen_test_report.sh` as it isn't used anymore. 10*63d4e48fSSadaf Ebrahimi 11*63d4e48fSSadaf EbrahimiMinor fix for `_flags_underscoreName()` to insure POSIX compliance. 12*63d4e48fSSadaf Ebrahimi 13*63d4e48fSSadaf EbrahimiCleanup of pre-GitHub cruft. 14*63d4e48fSSadaf Ebrahimi 15*63d4e48fSSadaf EbrahimiFixed bug in `_flags_columns()` where `stty size` sometimes gave unexpected 16*63d4e48fSSadaf Ebrahimioutput, causing the function to not work. 17*63d4e48fSSadaf Ebrahimi 18*63d4e48fSSadaf EbrahimiReplaced `test_runner` with upstream from https://github.com/kward/shlib. 19*63d4e48fSSadaf Ebrahimi 20*63d4e48fSSadaf Ebrahimi## Changes with 1.2.2 21*63d4e48fSSadaf Ebrahimi 22*63d4e48fSSadaf EbrahimiRan all scripts through [ShellCheck](http://www.shellcheck.net/). 23*63d4e48fSSadaf Ebrahimi 24*63d4e48fSSadaf EbrahimiReplaced `shflags_test.sh` with `test_runner` from 25*63d4e48fSSadaf Ebrahimihttps://github.com/kward/shlib. 26*63d4e48fSSadaf Ebrahimi 27*63d4e48fSSadaf EbrahimiFixed issue #45. Empty help string causes `shflags_test_issue_28.sh` to fail. 28*63d4e48fSSadaf Ebrahimi 29*63d4e48fSSadaf EbrahimiContinuous integration testing setup with [Travis 30*63d4e48fSSadaf EbrahimiCI](https://travis-ci.org/kward/shflags). 31*63d4e48fSSadaf Ebrahimi 32*63d4e48fSSadaf EbrahimiRestructured code to be more GitHub like. 33*63d4e48fSSadaf Ebrahimi 34*63d4e48fSSadaf Ebrahimi## Changes with 1.2.1 35*63d4e48fSSadaf Ebrahimi 36*63d4e48fSSadaf EbrahimiFixed issue #43. Added support for BusyBox `ash` shell. 37*63d4e48fSSadaf Ebrahimi 38*63d4e48fSSadaf EbrahimiFixed issues #26, #27. Re-factored `_flags_itemInList()` to use built-ins. 39*63d4e48fSSadaf Ebrahimi 40*63d4e48fSSadaf EbrahimiFixed issue #31. Documented newline support in FLAGS_HELP. 41*63d4e48fSSadaf Ebrahimi 42*63d4e48fSSadaf EbrahimiFixed issue #28. DEFINE_boolean misbehaves when help-string is empty. 43*63d4e48fSSadaf Ebrahimi 44*63d4e48fSSadaf EbrahimiFixed issue #25. Fix some typos. 45*63d4e48fSSadaf Ebrahimi 46*63d4e48fSSadaf Ebrahimi## Changes with 1.2.0 47*63d4e48fSSadaf Ebrahimi 48*63d4e48fSSadaf EbrahimiChanged from the LGPL v2.1 license to the Apache v2.0 license so that others can 49*63d4e48fSSadaf Ebrahimiinclude the library or make changes without needing to release the modified 50*63d4e48fSSadaf Ebrahimisource code as well. 51*63d4e48fSSadaf Ebrahimi 52*63d4e48fSSadaf EbrahimiMoved documentation to Markdown. 53*63d4e48fSSadaf Ebrahimi 54*63d4e48fSSadaf EbrahimiMigrated the code to GitHub as http://code.google.com/ is turning down. 55*63d4e48fSSadaf Ebrahimi 56*63d4e48fSSadaf EbrahimiFixed issue #10. Usage of `expr` under FreeBSD 7.2 (FreeNAS 0.7.1) and FreeBSD 57*63d4e48fSSadaf Ebrahimi8.0 that was causing many unit tests to fail. 58*63d4e48fSSadaf Ebrahimi 59*63d4e48fSSadaf EbrahimiFixed issue where booleans were sometimes mis-configured to require additional 60*63d4e48fSSadaf Ebrahimivalues like other flags. 61*63d4e48fSSadaf Ebrahimi 62*63d4e48fSSadaf EbrahimiChanged `_flags_fatal()` to exit with `FLAGS_ERROR` immediately. 63*63d4e48fSSadaf Ebrahimi 64*63d4e48fSSadaf EbrahimiFixed issue #11. When help is requested, the help flag is no longer prefixed 65*63d4e48fSSadaf Ebrahimiwith '[no]'. 66*63d4e48fSSadaf Ebrahimi 67*63d4e48fSSadaf EbrahimiUpgraded shUnit2 to 2.1.6. 68*63d4e48fSSadaf Ebrahimi 69*63d4e48fSSadaf EbrahimiFixed issue #12. Requesting help shouldn't be considered an error. 70*63d4e48fSSadaf Ebrahimi 71*63d4e48fSSadaf EbrahimiAdded the ability to override the use of the OS default `getopt` command by 72*63d4e48fSSadaf Ebrahimidefining the `FLAGS_GETOPT_CMD` variable. 73*63d4e48fSSadaf Ebrahimi 74*63d4e48fSSadaf EbrahimiUpdated `gen_test_results.sh` and versions from shUnit2 source. 75*63d4e48fSSadaf Ebrahimi 76*63d4e48fSSadaf EbrahimiFixed issues# 13, 14. Added support for dashes '-' in long flag names. The 77*63d4e48fSSadaf Ebrahimidefined flag will still be declared with underscores '\_' due to shell 78*63d4e48fSSadaf Ebrahimilimitations, so only one of a dashed flag name or an underscored flag name are 79*63d4e48fSSadaf Ebrahimiallowed, not both. (Backslash on \_ to prevent Markdown formatting.) 80*63d4e48fSSadaf Ebrahimi 81*63d4e48fSSadaf EbrahimiIssue #20. Updated LGPL v2.1 license from 82*63d4e48fSSadaf Ebrahimihttp://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt. 83*63d4e48fSSadaf Ebrahimi 84*63d4e48fSSadaf EbrahimiIssue #15. Use `gexpr` instead of `expr` on BSD variants. 85*63d4e48fSSadaf Ebrahimi 86*63d4e48fSSadaf EbrahimiMinor tweaks to make run on FreeBSD 9.1. 87*63d4e48fSSadaf Ebrahimi 88*63d4e48fSSadaf EbrahimiFixed issue in `shflags_test_public.sh` where screens >80 columns were causing a 89*63d4e48fSSadaf Ebrahimitest to fail. 90*63d4e48fSSadaf Ebrahimi 91*63d4e48fSSadaf EbrahimiIssue #22. Fixed broken testGetFlagInfo() test. 92*63d4e48fSSadaf Ebrahimi 93*63d4e48fSSadaf EbrahimiCreated alternate `validFloat()` and `validInt()` functions that use shell 94*63d4e48fSSadaf Ebrahimibuilt-ins where possible to increase performance and reduce the usage of the 95*63d4e48fSSadaf Ebrahimi`expr` command. 96*63d4e48fSSadaf Ebrahimi 97*63d4e48fSSadaf EbrahimiAdded separate built-in and `expr` functions for doing math. 98*63d4e48fSSadaf Ebrahimi 99*63d4e48fSSadaf Ebrahimi## Changes with 1.0.3 100*63d4e48fSSadaf Ebrahimi 101*63d4e48fSSadaf EbrahimiMAJOR CHANGE! `FLAGS_ARGC` is now obsolete, and is replaced by `FLAGS_ARGV`. See 102*63d4e48fSSadaf Ebrahimibelow for more info. 103*63d4e48fSSadaf Ebrahimi 104*63d4e48fSSadaf EbrahimiFixed issue# 7 where long flags defined with '=' (e.g. `--abc=123`) made it 105*63d4e48fSSadaf Ebrahimiimpossible for the user to know how many non-flag command-line arguments were 106*63d4e48fSSadaf Ebrahimiavailable because the value returned by `FLAGS_ARGC` was wrong. The `FLAGS_ARGC` 107*63d4e48fSSadaf Ebrahimivalue is now obsolete, but will be maintained for backwards compatibility. The 108*63d4e48fSSadaf Ebrahiminew method of getting the non-flag arguments is by executing `eval set -- 109*63d4e48fSSadaf Ebrahimi"${FLAGS_ARGV}"` after the `FLAGS` call. The arguments will then be available 110*63d4e48fSSadaf Ebrahimiusing the standard shell $#, $@, $\*, $1, etc. variables. (Backslash on \* to 111*63d4e48fSSadaf Ebrahimiprevent Markdown formatting.) 112*63d4e48fSSadaf Ebrahimi 113*63d4e48fSSadaf EbrahimiDue to above fix for issue# 7, there is now proper support for mixing flags with 114*63d4e48fSSadaf Ebrahiminon-flag arguments on the command-line. Previously, all non-flag arguments had 115*63d4e48fSSadaf Ebrahimito be at the end of the command-line. 116*63d4e48fSSadaf Ebrahimi 117*63d4e48fSSadaf EbrahimiRenamed `_flags_standardGetopt()` and `_flags_enhancedGetopt()` functions to 118*63d4e48fSSadaf Ebrahimi`_flags_getoptStandard()` and `_flags_getoptEnhanced()`. 119*63d4e48fSSadaf Ebrahimi 120*63d4e48fSSadaf EbrahimiTook out the setting and restoration of the '-u' shell flag to treat unset 121*63d4e48fSSadaf Ebrahimivariables as an error. No point in having it in this library as it is verified 122*63d4e48fSSadaf Ebrahimiin the unit tests, and provides basically no benefit. 123*63d4e48fSSadaf Ebrahimi 124*63d4e48fSSadaf EbrahimiFixed bug under Solaris where the generated help was adding extra 'x' 125*63d4e48fSSadaf Ebrahimicharacters. 126*63d4e48fSSadaf Ebrahimi 127*63d4e48fSSadaf EbrahimiAdded checks for reserved flag variables (e.g. `FLAGS_TRUE`). 128*63d4e48fSSadaf Ebrahimi 129*63d4e48fSSadaf EbrahimiFixed some unset variable bugs. 130*63d4e48fSSadaf Ebrahimi 131*63d4e48fSSadaf EbrahimiNow report the actual `getopt` error if there is one. 132*63d4e48fSSadaf Ebrahimi 133*63d4e48fSSadaf EbrahimiAll tests now properly enable skipping based on whether a standard or enhanced 134*63d4e48fSSadaf Ebrahimi`getopt` is found. 135*63d4e48fSSadaf Ebrahimi 136*63d4e48fSSadaf EbrahimiAdded the OS version to OS release for Solaris. 137*63d4e48fSSadaf Ebrahimi 138*63d4e48fSSadaf EbrahimiFixed `flags_reset()` so it unsets the default value environment vars. 139*63d4e48fSSadaf Ebrahimi 140*63d4e48fSSadaf Ebrahimi## Changes with 1.0.2 141*63d4e48fSSadaf Ebrahimi 142*63d4e48fSSadaf Ebrahimi${FLAGS_PARENT} no longer transforms into a constant so that it can be defined 143*63d4e48fSSadaf Ebrahimiat run time in scripts. 144*63d4e48fSSadaf Ebrahimi 145*63d4e48fSSadaf EbrahimiAdded warning about short flags being unsupported when there are problems 146*63d4e48fSSadaf Ebrahimiparsing the options with `getopt`. 147*63d4e48fSSadaf Ebrahimi 148*63d4e48fSSadaf EbrahimiAdd default values to end of description strings. 149*63d4e48fSSadaf Ebrahimi 150*63d4e48fSSadaf EbrahimiFixed bug that returned an error instead of success when recalling the default 151*63d4e48fSSadaf Ebrahimivalues for empty strings. 152*63d4e48fSSadaf Ebrahimi 153*63d4e48fSSadaf EbrahimiAdded warning when a duplicate flag definition is attempted. 154*63d4e48fSSadaf Ebrahimi 155*63d4e48fSSadaf EbrahimiImproved `assert[Warn|Error]Msg()` test helper grepping. 156*63d4e48fSSadaf Ebrahimi 157*63d4e48fSSadaf EbrahimiReplaced shell_versions.sh with a new versions library and created 158*63d4e48fSSadaf Ebrahimi`gen_test_results.sh` to make releases easier. 159*63d4e48fSSadaf Ebrahimi 160*63d4e48fSSadaf EbrahimiCopied the coding standards from shUnit2, but haven't fully implemented them in 161*63d4e48fSSadaf EbrahimishFlags yet. 162*63d4e48fSSadaf Ebrahimi 163*63d4e48fSSadaf EbrahimiIssue# 1: When a user defines their own `--help` flag, no more warning is thrown 164*63d4e48fSSadaf Ebrahimiwhen `FLAGS()` is called stating that the help flag already defined. 165*63d4e48fSSadaf Ebrahimi 166*63d4e48fSSadaf EbrahimiIssue# 2: Passing the `--nohelp` option no longer gives help output. 167*63d4e48fSSadaf Ebrahimi 168*63d4e48fSSadaf EbrahimiIssue# 3: Added support for screen width detection. 169*63d4e48fSSadaf Ebrahimi 170*63d4e48fSSadaf Ebrahimi## Changes with 1.0.1 171*63d4e48fSSadaf Ebrahimi 172*63d4e48fSSadaf EbrahimiFixed bug where the help output added '[no]' to all flag names 173*63d4e48fSSadaf Ebrahimi 174*63d4e48fSSadaf EbrahimiAdded additional example files that are referenced by the documentation. 175*63d4e48fSSadaf Ebrahimi 176*63d4e48fSSadaf EbrahimiImproved `zsh` version and option checking. 177*63d4e48fSSadaf Ebrahimi 178*63d4e48fSSadaf EbrahimiUpgraded shUnit2 to 2.1.4 179*63d4e48fSSadaf Ebrahimi 180*63d4e48fSSadaf EbrahimiAdded unit testing for the help output. 181*63d4e48fSSadaf Ebrahimi 182*63d4e48fSSadaf EbrahimiWhen including a library (e.g. shflags) in a script, zsh 3.0.8 doesn't actually 183*63d4e48fSSadaf Ebrahimiexecute the code in-line, but later. As such, variables that are defined in the 184*63d4e48fSSadaf Ebrahimilibrary cannot be used until functions are called from the main code. This 185*63d4e48fSSadaf Ebrahimirequired the 'help' flag definition to be moved inside the FLAGS command. 186*63d4e48fSSadaf Ebrahimi 187*63d4e48fSSadaf Ebrahimi## Changes with 1.0.0 188*63d4e48fSSadaf Ebrahimi 189*63d4e48fSSadaf EbrahimiThis is the first official release, so everything is new. 190