|
1 | 1 | # Changelog |
2 | 2 |
|
3 | | -## 1.1.0 (2025-07-04) |
| 3 | +## 2.0.0 (20225-07-08) |
| 4 | + |
| 5 | +- feat(BREAKING CHANGE): optimized structure of return object with parsed elements\ |
| 6 | + Example: `cli --verbose file.txt -- one two`\ |
| 7 | + Return:\ |
| 8 | + **Old v1.x**: |
| 9 | + ```json5 |
| 10 | + { |
| 11 | + verbose: true, |
| 12 | + _: ['file.txt', 'one', 'two'], |
| 13 | + } |
| 14 | + ``` |
| 15 | + **New v2.x**: |
| 16 | + ```json5 |
| 17 | + { |
| 18 | + args: {}, |
| 19 | + flags: { verbose: true }, |
| 20 | + _: ['file.txt'], |
| 21 | + _tail: ['one', 'two'], |
| 22 | + } |
| 23 | + ``` |
| 24 | +- feat: added `args` option for named positional arguments |
| 25 | +- feat: added support for variadic arguments (e.g. `...files`) to collect last arguments into array |
| 26 | +- feat: added `boolean` option to treat flags as booleans without consuming values |
| 27 | +- feat: return property `_` now contains only positional arguments before `--` |
| 28 | +- feat: added return property `_tail` to capture all arguments after `--` |
| 29 | +- refactor: removed internal helpers and flattened implementation to keep compact code |
| 30 | +- test: added tests for named positional arguments |
| 31 | +- docs: improved README, added usage examples |
| 32 | + |
| 33 | +## 1.1.0 (2025-07-04) First stable release |
4 | 34 |
|
5 | | -- first stable release |
6 | 35 | - feat: rename options for compatibility to yargs-parser options |
7 | 36 | - feat: optimize npm package for smaller size: 12kB -> ~5kB |
8 | 37 | - feat: add d.ts file |
|
13 | 42 |
|
14 | 43 | ## 1.0.0 (2025-07-04) UNPUBLISHED as not ready for release |
15 | 44 |
|
16 | | -## 0.0.2 (2025-07-02) |
| 45 | +### Features: |
| 46 | + |
| 47 | +- Short boolean flag: `-f` |
| 48 | +- Short flag with value: `-f value` |
| 49 | +- Grouped short flags: `-xyz` (equivalent to `-x` `-y` `-z`) |
| 50 | +- Long boolean flag: `--flag` |
| 51 | +- Long flag with value: `--flag=value` or `--flag value` |
| 52 | +- Dashed long flag: `--foo-bar` (available as `flags['foo-bar']` and `flags.fooBar`) |
| 53 | +- Multi-values: `--keys foo bar` |
| 54 | +- Short-to-long alias: `-f` = `--files` |
| 55 | +- Default values for flags |
| 56 | + |
| 57 | + |
| 58 | +## 0.0.2 (2025-07-02) experimental working version |
17 | 59 |
|
18 | 60 | - fix: resolving files in package.json for CommonJS |
19 | 61 |
|
20 | | -## 0.0.1 (2025-07-01) UNPUBLISHED as experimental not working version |
| 62 | +## 0.0.1 (2025-07-01) UNPUBLISHED as not working experimental version |
21 | 63 |
|
22 | 64 | - chore(experimental): create small and fast CLI flag parser as lightweight alternative to yargs-parser |
0 commit comments