Skip to content

Releases: gookit/gcli

v3.5.0

06 Jun 16:18

Choose a tag to compare

Change Log

Refactor

  • refactor(gcli): strictMode 收敛为驱动 gflag EnhanceShort,弃用盲拆短选项 c23dc37

Feature

  • feat(gflag): CliOpt.Question 声明式交互收集(B7) 743711f
  • feat(gflag): FromStruct 支持 TagRuleField 标签规则 49faaa4
  • feat(gflag): FromStruct 支持匿名嵌套字段展开 2aa7bee
  • feat(gflag): EnhanceShort 短选项规范化预处理(expandShortArgs) daf0646
  • feat(examples): 新增 B4-B7 特性演示命令 60bea2f
  • feat(gflag): EnhanceShort 增加语义常量 None/Merge/Attach a0ee47f
  • feat(gcli): 支持全局 EnhanceShort 设置 0c51299

Other

  • chore(gflag): B6 收尾打磨 ef066ce
  • docs: 修正短选项合并说明(需 EnhanceShort/strict 开启) 2da8714
  • docs(plans): B4+B5 标记完成并记录实际落地 668e041
  • docs: README 介绍最近新增功能(B4-B7) c84ea8a
  • test: merge to test files to one file bafa73f
  • docs(blogs): 新增 v3.4 新特性介绍 blog(中英双语) d8c702c
  • docs: 补全局 EnhanceShort 说明 + CHANGELOG v3.4.1/v3.5.0 56c914f
  • docs(blogs): blog 对齐 v3.5.0 发版 + 补全局 EnhanceShort f87c9e3
  • docs(changelog): v3.5.0 增加 Highlights 总览 a38acdb
  • docs(blogs): blog 行宽规整(英文 120 折行 / 中文每段一行) 70d4fe4

v3.4.1

06 Jun 01:51

Choose a tag to compare

Change Log

Feature

  • feat(completion): 区分 --in-completion(动态) 与 --gen-completion(静态) 两个内置选项 d41dbf6
  • feat(completion): 内置 --gen-completion 静态生成补全脚本(免注册 genac) 3a76280
  • feat(completion): 运行期动态补全候选计算(--in-completion) 88d70e9
  • feat(completion): 生成脚本委托动态 + 静默补全模式 + genac --static opt-in 79f178e
  • feat(completion): 新增 PowerShell(pwsh) 动态补全 49a6f6d
  • feat(completion): 选项值候选 CliOpt.Choices(子阶段4) 75bc031
  • feat(cmd): 命令级中间件 Use()(B2) 7cec911
  • feat(app): 应用级中间件 App.Use()(B2 收尾) 66502f7

Fixed

  • fix(cmd): doExecute 的 recover 改为 defer, 真正捕获执行期 panic 467d883

Other

  • chore: gitignore 项目 tmp/ 工作目录(R003) fb2fca5
  • docs(plans): 新增 B1 运行期动态补全实现计划 4fb8826
  • docs(plans): 新增 B2 命令中间件实现计划 a80c2d7
  • docs(plans): 新增 B4+B5 POSIX 短选项增强实现计划 cc4fcce
  • docs(plans): 新增 B6 结构体标签增强 + B7 声明式交互收集计划 5eaee5f
  • chore: 清理已实现功能的陈旧 TODO 注释,TODO 索引链接 B 类功能计划 bc2b613
  • chore: update some docs and comments 87316cb
  • docs(plans): 标记 B1 静态 --gen-completion 已完成,动态待实现 a71a845
  • docs(plans): 标记 B1 动态补全候选计算已完成,剩脚本委托/选项值候选 72124ad
  • chore: move some builtin example to _examples 7aa7096
  • chore: update some example demo cli 430b665
  • docs(plans): B1 内置补全选项全部完成(静态/动态/委托/静默/pwsh/Choices) 9b7aae4
  • docs(plans): B2 命令级中间件已完成,记录 App.Use 与 recover no-op 遗留 98bde2c
  • docs(todo): recover fix 完成; 记录预存 shuffle 测试隔离债 059177b
  • docs(plans): B2 全部完成(命令级/App级中间件 + recover fix) 27367ba
  • test: 消除包级共享 fixture,修复 -shuffle 测试隔离债 2a6af97
  • docs(todo): 标记 shuffle 测试隔离债已清理 7135232

v3.4.0

05 Jun 02:43

Choose a tag to compare

Change Log

Refactor

  • refactor(gcli): 移除全局默认 --verbose 选项,改由 GCLI_VERBOSE 控制 eb09709
  • refactor(gflag): 抽取 validateAll,合并 Parse/ParseOpts 重复校验逻辑 c4f337e
  • refactor(gcli): 全局选项统一为单一数据源(App 复用 gOpts) 43b6b43
  • refactor(app): findCommandName 改为无副作用返回 foundCmd ee0af38
  • refactor(helper): 迁移 helper 至 internal/helper,删除空壳 internal/help_tpl.go a60f0a4

Feature

  • feat(help): 支持按 Category 对命令分组显示帮助 9e8fae2
  • feat(gflag): 支持按 Category 对选项分组显示帮助 9dea78d

Fixed

  • fix(cmd): 修复 Command.Copy() 误清空原命令 Hooks 的 bug 84a3f87
  • fix(gflag): Parse 不再静默吞掉内部 panic d4c8b25
  • fix(examples): 修复 progress_demo 剩余的 int64 参数类型错误 8fa6121
  • fix(app): 修复 help COMMAND 失效与 findSimilarCmd 污染命令注册表 7d62dd8

Other

  • build: 更新 goutil 依赖至稳定版本 v0.7.5 17a5d80
  • build(deps): bump github.com/gookit/cliui from 0.2.3 to 0.2.4 (#159) e853f5e
  • build(deps): bump github.com/gookit/cliui from 0.2.4 to 0.3.0 (#160) 65a7a11
  • build(deps): bump github.com/gookit/goutil from 0.7.5 to 0.7.6 (#161) 80735ef
  • chore: update some docs and fix demo error eff5d6a
  • docs: 补充命令/选项分类(Category)用法说明 cad1b73
  • docs(plans): 新增 A/F/G 结构性重构实现计划(待评审) b4a8053
  • chore: update ci config and rm some files 7f614c7
  • docs(plans): 计划新增 H 项——helper 收敛 internal 并清理死代码 e09d9fb
  • chore: 移除未引用的 gclicom 包 bc0d468
  • chore(app): gofmt 规整 prepareRun 上方 doc 注释(本轮已重度修改该文件) 18f7ed4
  • docs(todo): 记录重构期间发现的既有问题(help COMMAND 失效等) 6e74bb0
  • chore: gofmt 规整预存格式漂移(gflag/gflag.go、gflag/util.go、tcp_proxy.go) 2f25d9e
  • docs(todo): 勾选已完成的 A/F/G/H 重构项 0534175
  • docs: 新增 CHANGELOG 并发布 v3.4.0;version 常量更新为 3.4.0 a781a09
  • docs(todo): 勾选 CHANGELOG/发版准备项 7e25cd3
  • chore: upgrade dep to latest and update the assert pkg path 9465b8b

v3.3.1

04 May 05:57

Choose a tag to compare

Change Log

Refactor

  • refactor: remove show,progress,interact packages, use gookit/cliui instead. f0b69e9

Fixed

  • fix: 修复参数命名不一致问题并添加.gitignore条目 3cb3887

Update

  • up: remove binding global options: no-progress, no-interactive. 4e7f205

Other

  • build(deps): bump softprops/action-gh-release from 2 to 3 (#158) f02dbad
  • chore: update some code style in interact c22bc9c
  • docs: 更新文档和注释中的拼写错误及废弃提示 9ac9169
  • build: 更新依赖版本 3021d9a
  • chore: 移除已弃用的包并重定向到cliui 32826b4

v3.3.0

25 Dec 01:27

Choose a tag to compare

Change Log

Fixed

  • fix: fix app can't run with default command. see #130 f9cd400

Feature

  • ✨ feat: gflag - support set default value from ENV var 8d6eabc
  • ✨ feat: struct named rules parse adds key: 'short' (alias of 'shorts') 693bf81
  • ✨ feat: show - add title and banner info render on cli e3fec7b
  • ✨ feat: show - add cli table render implement 6532f86
  • feat(gflag): add duration type options support: DurationOpt, DurationOpt2 and DurationVar e12108c
  • ✨ up: gflag - update flag validate logic, support custom value Collector c22a4b0

Update

  • 👔 up: update the gcli ChWorkdir logic, will direct call os.Chdir 98e8a7a
  • 👔 up: update the app findCommandName, prepareRun logic cd73a7a
  • 👔 up: update the show List - not show func, chan type and add option: FilterFunc 17da7fb
  • 👔 up: add new event for app help render 6de1e9c
  • ♻️ up: show - move Title, Banner to sub package 3c952ba
  • 👔 up: show/title - update some logic, add more option func 613bd59
  • 👔 up: update some for help render a7a5569
  • 👔 up: add some new method for binding options 19a5c4a
  • 👔 up: update deps, some comments b505d41
  • 👔 up: update deps, update show table define a95b860
  • 👔 up: show/table - add some new built in style, update default options bf0cc62
  • 👔 up: show/table - add new style FirstColor 4a89e0f
  • 👔 up: show/table - add more options for render table 7b28a62
  • 👔 up: show/table - update head render logic and some style config f20479e
  • 👔 up: show/table - update cell width and height calc 63b30e7
  • 👔 up: show/table - update table heads handle logic 5a9aa97
  • 👔 up: show/table - update table border show control logic 3d30776
  • 👔 up: show/table - update L,R border show control logic 3e08d95
  • 👔 up: show/table - enhance table row render, support multiline content on cell 98c04e1
  • ♻️ up: show - refactoring the show.Base to showcom.Base 54009a6
  • 👔 up: show/banner - enhance the banner, add options: MarginL, Height, MinWidth, PercentWidth 16cd8c6
  • 👔 up: show - update some components init and render logic 8efa682

Other

  • build(deps): bump github.com/gookit/goutil to 0.7.3
  • build(deps): bump golang.org/x/crypto to 0.36.0 (#149) c061da3
  • build(deps): bump morphy2k/revive-action to 2.7.8 (#153) e5b89a7
  • 💚 ci: Tidy go mod before run ci tests 0cabff2
  • 🎨 chore: update some code style and comments 3123ce2
  • ⬆️ dep: mod tidy for update deps aef650b
  • build(deps): bump github/codeql-action from 3 to 4 (#155) b17ce73
  • build(deps): bump actions/checkout from 4 to 6 (#156) ce0568e
  • chore: add issues example, rm invalid puml file 4c7bc9b
  • chore(deps): update deps and actions 95d3a47
  • chore(build): ignore all go.work related files a8eeded
  • test: add case for default command and update some tests 4c86855
  • chore(ci): Update the Go workflow configuration 45c1933

Full Changelog: v3.2.4...v3.3.0

v3.2.4

12 Dec 02:40
ccccd0f

Choose a tag to compare

Change Log

Fixed

  • 🐛 fix: gflag - fix type name error on render help 0a4a98c

Feature

  • ✨ feat: gflag - add new method FuncOpt() for quick add a func option flag eb7aa3b
  • ✨ feat: gflag - support bind struct field is addressable and implements flag.Value 899f00d
  • ✨ feat: gflag - built in support shortcut option parsing 1dd8c1e

Update

  • 👔 up: gflag - update options init and parse logic 781aadb
  • ♻️ up: gflag - use built in FlagSet instead of flag.FlagSet 8497657
  • 👔 up: gflag - update some util func and tests f66a879

Other

  • build(deps): bump WillAbides/setup-go-faster from 1.8.0 to 1.9.0 (#97) 62a1d1a
  • build(deps): bump golang.org/x/crypto from 0.11.0 to 0.12.0 (#98) f558bdb
  • build(deps): bump WillAbides/setup-go-faster from 1.9.0 to 1.9.1 (#99) 4f25067
  • build(deps): bump WillAbides/setup-go-faster from 1.9.1 to 1.10.0 (#100) 4038651
  • 👔 chore: all - update some tests and example codes 0c0e1b8
  • build(deps): bump WillAbides/setup-go-faster from 1.10.0 to 1.10.1 (#101) d83f4b3
  • build(deps): bump morphy2k/revive-action from 2.5.2 to 2.5.3 (#102) bb3d958
  • build(deps): bump actions/checkout from 3 to 4 (#103) d063172
  • build(deps): bump golang.org/x/crypto from 0.12.0 to 0.13.0 (#104) e015a48
  • build(deps): bump WillAbides/setup-go-faster from 1.10.1 to 1.11.0 (#105) ae201fd
  • build(deps): bump WillAbides/setup-go-faster from 1.11.0 to 1.12.0 (#106) a5257aa
  • build(deps): bump golang.org/x/crypto from 0.13.0 to 0.14.0 (#107) 21a8b74
  • build(deps): bump morphy2k/revive-action from 2.5.3 to 2.5.4 (#109) 2c531c4
  • build(deps): bump golang.org/x/crypto from 0.14.0 to 0.15.0 (#111) 5edab83
  • build(deps): bump golang.org/x/crypto from 0.15.0 to 0.16.0 (#112) 6298be5
  • build(deps): bump WillAbides/setup-go-faster from 1.12.0 to 1.13.0 (#113) c58264e
  • build(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0 (#114) 133b509
  • build(deps): bump morphy2k/revive-action from 2.5.4 to 2.5.5 (#116) d67f10b
  • build(deps): bump github.com/gookit/goutil from 0.6.12 to 0.6.15 (#115) 50edc44
  • build(deps): bump morphy2k/revive-action from 2.5.5 to 2.5.6 (#117) 7195338
  • build(deps): bump golang.org/x/crypto from 0.17.0 to 0.18.0 (#118) 27ee58f
  • build(deps): bump WillAbides/setup-go-faster from 1.13.0 to 1.14.0 (#119) cf0370b
  • build(deps): bump golang.org/x/crypto from 0.18.0 to 0.19.0 (#120) df03681
  • build(deps): bump morphy2k/revive-action from 2.5.6 to 2.5.7 (#121) 491555a
  • build(deps): bump golang.org/x/crypto from 0.19.0 to 0.20.0 (#122) bdb9e79
  • build(deps): bump softprops/action-gh-release from 1 to 2 (#124) 9837c3c
  • build(deps): bump golang.org/x/crypto from 0.20.0 to 0.23.0 (#126) 8605874
  • build(deps): bump golang.org/x/crypto from 0.23.0 to 0.24.0 (#127) 9fcbbec
  • build(deps): bump github.com/gookit/goutil from 0.6.15 to 0.6.17 (#137) 756aa86
  • build(deps): bump golang.org/x/crypto from 0.24.0 to 0.31.0 (#139) 69fe2af
  • build(deps): bump morphy2k/revive-action from 2.5.7 to 2.7.1 (#140) ccccd0f

v3.2.3

27 Jul 11:08

Choose a tag to compare

Change Log

Feature

  • ✨ feat: event support prefix hooks(eg: app.*), add new event: OnAppExit 4566d6a

Other

  • ⬆️ dep: update gookit/color and goutil to latest 6720e51
  • 📦 chore: update the go.sum file 6925fd3
  • build(deps): bump golang.org/x/crypto from 0.10.0 to 0.11.0 (#94) 0c48921

v3.2.2

25 Jun 16:47

Choose a tag to compare

Change Log

Feature

  • ✨ feat(flag): add some new ext flag value implements a3fda82
  • ✨ feat(opt): support bind default value from flag ptr 0b038f5
  • ✨ feat(gflag): add new flag parse config IndentLongOpt 21da8f9

Update

  • 👔 up(gflag): update the binding options from struct logic f00baba
  • 👔 up(app): update the command register logic, set IndentLongOpt=true 69d1c14
  • 👔 up(show): MList support struct and any map data for render 9dc5969
  • 👔 up: update some for flag parse logic, update deps to latest c5600f8

Other

  • build(deps): bump golang.org/x/crypto from 0.6.0 to 0.7.0 (#81) f69e782
  • build(deps): bump github.com/gookit/goutil from 0.6.6 to 0.6.7 (#82) fc4b8b8
  • build(deps): bump morphy2k/revive-action from 2.4.1 to 2.5.0 (#83) 58bb452
  • build(deps): bump morphy2k/revive-action from 2.5.0 to 2.5.1 (#84) 776ef14
  • build(deps): bump github.com/gookit/color from 1.5.2 to 1.5.3 (#85) 9ee8ea0
  • ⬆️ chore(dep): update the gookit/goutil to v0.6.8 aba53f6
  • build(deps): bump golang.org/x/crypto from 0.7.0 to 0.8.0 (#87) dd22258
  • build(deps): bump morphy2k/revive-action from 2.5.1 to 2.5.2 (#89) 6521dc3
  • ⬆️ dep: upgrade the x/crypto v0.7.0 to v0.10.0 ef8e59b

What's Changed

Full Changelog: v3.2.1...v3.2.2

v3.2.1

26 Feb 03:54

Choose a tag to compare

Change Log

Feature

  • ✨ feat(gflag): add new methods args.WithAfterFn and update tag value parse 2804f64

Update

  • 👔 up(app): update app and cmd run logic, app.RunCmd now will return error bc43572
  • 👔 up(show): update some for emoji render and some docs 67c2b18
  • 👔 up: update app and cmd help render logic dd8e114

Other

  • ⬆️ dep: update all deps to the latest version 2925e1a
  • ⬆️ dep: update gookit/goutil to the latest version eba208b

v3.2.0

12 Feb 02:42

Choose a tag to compare

Change Log

Fixed

  • fix(ci): github action config error on go1.20 031895d
  • ✅ fix(gflag): fix a options test check error 4408098
  • 💚 fix: build error on use not exists method 0eef495

Feature

  • ✨ feat(gflag): add more config func for quick config flag option 63d2520

Update

  • 👔 up: update some for command help display format ac59105
  • 👔 up: update the cli option binding logic 24474f7
  • 💥 update(all): will not support on go < 1.18 5d90613
  • 💥 update(cmd): param args will exclude named arguments on run cmd.Func 76bdb02
  • 👔 up(cmd): add panics recover handle on run cmd.Func 1c0ad15
  • 👔 up(cmd): update some cmd events fire logic 3657720
  • 👔 up(gflag): update the command arguments help render logic fa84b6f
  • 👔 up: update the cmd event fire, will notify parents and app cf7abed

Other

  • chore: update deps and add tests on go1.20 c1a77a9
  • ✅ test(gflag): add more tests for flag option 607a29b
  • build(deps): bump golang.org/x/term from 0.4.0 to 0.5.0 a7b2f23
  • build(deps): bump golang.org/x/crypto from 0.5.0 to 0.6.0 1852da4
  • ⬆️ dep: upgrade the gookit/goutil to v0.6.4 8524056
  • 💚 test: fix unit tests error on run go test 8e7b9a8