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 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
|
# Cri News
## 2.15.12
Changes:
- Dropped support for Ruby 2.5
## 2.15.11
Fixes:
- Added support for Ruby 3.0 (#111)
Changes:
- Dropped support for Ruby 2.3 and 2.4 (#112)
## 2.15.10
Fixes:
- Fixed warnings appearing in Ruby 2.7 (9a3d810)
## 2.15.9
Fixes:
- Fixed bug which could cause options from one command appear in other commands (#101, #102)
## 2.15.8
Fixes:
- Don’t explicitly set default values for options (#99)
This release reverts a backwards-incompatible change introduced in 2.15.7.
To illustrate this, compare the behavior of the following command in recent versions of Cri:
```ruby
option :f, :force, 'use force', argument: :forbidden
run do |opts, args, cmd|
puts "Options = #{opts.inspect}"
puts "Force? #{opts[:force]}"
puts "Option given? #{opts.key?(:force)}"
end
```
In Cri 2.15.6, the default is not set in the options hash, so the value is `nil` and `#key?` returns false:
```sh
% ./run
Options = {}
Force? nil
Option given? false
```
This behavior was inconsistent with what was documented: flag options were (and still are) documented to default to `false` rather than `nil`.
In Cri 2.15.7, the default value is `false`, and explicitly set in the options hash (`#key?` returns `true`):
```sh
% ./run
Options = {:force=>false}
Force? false
Option given? true
```
This change made it impossible to detect options that were not explicitly specified, because the behavior of `#key?` also changed.
In Cri 2.15.8, the default value is also `false` (as in 2.15.7), but not explicitly set in the options hash (`#key?` returns `false`, as in 2.15.6):
```sh
% ./run
Options = {}
Force? false
Option given? false
```
This backwards-incompatible change was not intentional. To fix issue #94, a change in behavior was needed, but this change also affected other, previously-undefined behavior. The new behavior in 2.15.8 should fix the bug fixed in 2.15.7 (#94, #96), without causing the problems introduced in that version.
## 2.15.7
Fixes:
- Options with a forbidden argument now default to false, rather than nil (#94, #96)
## 2.15.6
Fixes:
- Fixed problem with help header not being shown if the summary is missing (#93)
## 2.15.5
Fixes:
- Restored compatibility with Ruby 2.3. (#91)
## 2.15.4
Fixes:
- Removed dependency on `colored`, which restores functionality to gems that `colored` breaks (e.g. `awesome_print`) (#89, #90)
## 2.15.3
Fixes:
- Made `ArgumentList#each` callable without a block, in which case it returns an `Enumerator` (mimicking `Array`) (#87, #88)
## 2.15.2
Fixes:
- Fixed option propagation for two levels or more (#85, #86)
## 2.15.1
Fixes:
- Made -h/--help not fail when parameters are defined for the command that -h/--help is called on (#76, #78)
Enhancements:
- Made `#option` raise an error when unrecognised parameters are passed to it (#77) [Marc-André Lafortune]
## 2.15.0
Features:
- Added support for parameter transformation (#72)
## 2.14.0
Features:
- Added `Cri::Command.load_file`
## 2.13.0
Features:
- Added support for explicitly specifying zero parameters using `#no_params` (#71)
## 2.12.0
Features:
- Added support for parameter naming and validation (#70)
## 2.11.0
Features:
- Added support for transforming option values (#68)
## 2.10.1
Fixes:
- Restored Ruby 2.1 compatibility (for now)
## 2.10.0
Features:
- Added support for skipping option parsing (#62) [Tim Sharpe]
This release drops support for Ruby 2.1, which is no longer supported.
## 2.9.1
Fixes:
- Made default values be always returned, even when not explicitly specified (#57, #58)
## 2.9.0
Features:
- Allowed specifying default option value (#55)
Enhancements:
- Added support for specifying values for combined options (#56)
## 2.8.0
Features:
- Allowed passing `hard_exit: false` to `Command#run` to prevent `SystemExit` (#51)
- Allowed specifying the default subcommand (#54)
## 2.7.1
Fixes:
- Fixed some grammatical mistakes
## 2.7.0
Features:
- Added support for hidden options (#43, #44) [Bart Mesuere]
Enhancements:
- Added option values to help output (#37, #40, #41)
- Made option descriptions wrap (#36, #45) [Bart Mesuere]
## 2.6.1
- Disable ANSI color codes when not supported (#31, #32)
## 2.6.0
- Added support for multi-valued options (#29) [Toon Willems]
## 2.5.0
- Made the default help command handle subcommands (#27)
- Added `#raw` method to argument arrays, returning all arguments including `--` (#22)
## 2.4.1
- Fixed ordering of option groups on Ruby 1.8.x (#14, #15)
- Fixed ordering of commands when --verbose is passed (#16, #18)
## 2.4.0
- Allowed either short or long option to be, eh, optional (#9, #10) [Ken Coar]
- Fixed wrap-and-indent behavior (#12) [Ken Coar]
- Moved version information into `cri/version`
## 2.3.0
- Added colors (#1)
- Added support for marking commands as hidden
## 2.2.1
- Made command help sort subcommands
## 2.2.0
- Allowed commands with subcommands to have a run block
## 2.1.0
- Added support for runners
- Split up local/global command options
## 2.0.2
- Added command filename to stack traces
## 2.0.1
- Sorted ambiguous command names
- Restored compatibility with Ruby 1.8.x
## 2.0.0
- Added DSL
- Added support for nested commands
## 1.0.1
- Made gem actually include code. D'oh.
## 1.0.0
- Initial release!
|