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