-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCHANGELOG
More file actions
590 lines (472 loc) · 18.7 KB
/
CHANGELOG
File metadata and controls
590 lines (472 loc) · 18.7 KB
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# CHANGELOG
- v2.2.0
- upgrade toolchain to go1.25+
- upgrade deps
- v2.1.67
- fix help system wrong output of lines in invoking subcmd
- cleanup codes in blueprint/main.go
- added package desc to worker/
- upgrade deps
- security patches
- v2.1.66
- upgrade deps
- security patches
- v2.1.65
- list subitems of a negatable flag in help screen
- improve & add a little doc
- added `cmdr.Args()`
- upgrade deps
- security patches
- v2.1.61
- upgrade deps
- security patches
- v2.1.60
- [hs] improved help subsystem
- fixed possible errors
- improved codes for linting issues
- upgrade deps
- security patches
- v2.1.55
- UPGRADE GO TOOLCHAIN TO 1.24.x (1.24.5)
- upgrade deps
- v2.1.51
- upgrade deps
- security patch
- v2.1.50
- upgrade deps
- logg - update fg of INFO level
- is - added `Color.AddAndNew()`
- v2.1.48
- improved app version for dev-time
`conf.Version` will be unchanged if passing an empty ("-") version from main()
- update workflow file to improve release notes
- upgrade deps
- logg - fix error in verbose mode
- v2.1.47
- update workflow file to improve release notes
- upgrade deps
- is - added more os & arch detector such as `BSD()`
- logg - added `ResetDefault()`
- store - doc to dupS
- v2.1.46
- improved builtin help system command - support history commands
- remove `dirs` since it moved into `hedzr/is` repo
- added `ActionRunHelpSystem`, run it with `app.DoBuiltinAction(ctx,action)`
- improved prompt example app (history support)
- upgrade deps
- is - added `dirs` for common folders; history supports in `makenewterm`
- logg - added `Painter` interface (still unstable)
- v2.1.45
- upgrade deps
- security patches
- v2.1.43
- improved `RedirectTo`
- fix redirectTo cmd in help screen
- changed to `RedirectTo(dottedPath string, recursive ...bool) CommandBuilder`
support checking if any parents has been redirected so that a child subcmd can be forwarded as is
- improved help screen
- fix align between short cmd and long
- REPLACED with new build system / gh actions / makefiles
- v2.1.39
- improved `devmode`
- cleanup codes moved into `is` lib
- improved logics
- remove `bi` as a title of `built-info` internal command
- improved short-title in help screen
- improved codes to describ `ParsedState` better
- fix help system to work for `help` command without args
- upgrade deps
- `is` - improved cross-building and cross-working, add `devmode` state
- `logg` - compliant with `devmode` in `is/states`
- v2.1.38
- implement reverse binding to struct field when using `FromStruct(&structValue)`
- commandbuilder: added `BindPositionalArgsPtr(varptr *[]string)`
- flagbuilder: added `BindVarPtr(varptr any)`
- improved structbuilder
- improved devmode warning to tip developer the proper usage for bind-to-field
- improved `ActionEnum`: added `ActionNone`
- fix `~~debug` debug screen - added positional args dump section
- fix default-value in help screen
- sometimes envvar cannot be filled into default-value field
- fix `onEnvVarMatched` to fill in default-value field, and typo
- v2.1.37
- added `FromStruct()` to commandbuilder
- reimplemented structbuilder to compliant with both root and subcmd cases
- improved backtraceCmdNamesG to trace the cycle ref case of owner pointer, and give a warning to developer
- fix `pkg/logz`'s `SetLevel()` to apply the setting level to global logz (`logg/slog`)
- fix helpscreen to remove the double empty lines
- fix `WithOpts` to take effects specially for `WithArgs(args...)`
- upgrade deps
- `is` - fix the raising `states.on[State]Changed` (state = Debug or Trace)
- `logg` - fix/improved init.go for states changed
- v2.1.36
- added `BuildFrom(structValue,opts...)` to `Creator` interface
- added new example app `examples/tiny/struct`
- added new builder `FromStruct` to build the command system from a struct value
you can write a struct type and pass its value into FromStruct to build root
command and its subcommands now.
- fix `RootBuilder()` caused incorrect inCmd (-1)
- fix a debug call
- fix `OwnerIsNil` ...
- v2.1.35
- improved `prompt` examples
- fix withopts.go - uses `basics.Openable`
- fix devmode.go - uses `term.DisableColors()`
- upgrade deps
- `is/term/color`, `term`, and `basics`
- v2.1.31
- supported `SetCancelFunc()` & `WithCancelFunc()`
cmdr.v2 manage ctx & cancel now, querying by `CancelFunc()`
- improved `~~debug` output with the final value of a cmdline flag
- improved `devmode.go`
- update example apps
- remove unnecessary codes
- added prompt mode example app
- upgrade deps
- `is/term/color` - more `color.Color` implements
- `Store` - support `BR()`
- v2.1.27
- fix `color.Color` usages
- extract common init seq to `earlierInitForNew`
- upgrade deps
- `is/term/color` - new `color.Color` type
- `logg/slog` - fixed bugs
- v2.1.26
- improved help-system - `app help` enter into prompt mode
- added `Skip` to logz subpkg
- `onEnvVarMathed`: improved the triggerring event - add missed `OnParsedValue`
- devmode.go - disable info() in non-verbose-mode
- fix dockerfile
- remove `prompt` (move into cmdr-examples)
- upgrade deps
- `is/term` - added `MakeRawWrapped`, `MakeNewTerm`
- `logg/slog` - improved howto dumping error object
- v2.1.25
- improved devmode.go
- improved doc; typo; example app code
- upgrade deps
- better ansi color builder
- better err object in logz output - ensure stacktrace dumped in debug mode enabled
- v2.1.23
- improved no-color mode [devmode.go]
- ignore go test params in cmdline
- improved help screen
- nested indent for tree mode
- improved no-color mode
- improved `is.ColorfulTty`
- improved pipe state detecting
- improved help screen for pipe mode and redirect mode
- v2.1.22
- added `passThruNow` for a subcmd
- added `UpdateHitInfo` to `CmdS`
- fix `HELP=1` not work
- improved autoenv feature
- changed: `APP_VERSION` has no effect to map into `--version` (but `VERSION` can do it)
- fix `ignoreUnmatched` for a subcmd - add as positional arg without leading '-'
- fix `desc`, `examples` fields for help screen
- fix/improved `BaseOpt` fields order for better inspecting in debugging time
- upgrade deps & security patch
- v2.1.21
- added `ignoreUnmatched` for a subcmd
so that all unmatched flags are treated as positional args instead of raising an error
- improved infra-tests
- added `CtxKeyHelpScreenWriter` for testing
- confirm `TestStoreGetSectionFrom` worked
- added `tasksAfterRun` for finalVerifier in testing
- improved `taskAfterParse`
- fix `baseopt.Set()` for top-level flags
- fix `cmd.Store(...)` & `cmd.Set(...)`
- fix `--version` & `-#`
- fix `--`
- fix `flag.required` (a typo)
- fix `flag.Clone()` for the recently-added fields
- fix command heading in help screen
- upgrade deps & security patch
- v2.1.19
- enhanced `RedirectTo` to work for subcmd
- improved `RedirectTo` in help screen
- trace all `redirected` commands,
- trace all matched `redirected` commands to avoid the dead loop
- matching the flag with the both owners: this and `redirected` command
- fix too long valid args not break in help screen
- support `COLS` envvar to override termsize detector
- improved `printTailLine()` for help screen
- improved logz level which will sync'd with cmdline flag matched (eg, `--debug`)
- improved description, examples, notes in help screen
- v2.1.18
- fix *not-hidden* cmd/flg if its owner/parent is hidden in helpscreen
- added `Cmd.HiddenBR`/`VendorHiddenBR`, and impl them for `*CmdS` and `*Flag`
- improved desc, examples, and notes fields in help screen
- improved errcheck, added `errShouldStopParsingLoop` for better cancel the parser's loop
- improved `onUnknownCommandMatched` warning message form
- v2.1.17
- upgrade deps
- security patches
- v2.1.16
- new feature `-W`-style for `Negatable Flag`
- fix `workerS.commandsToStoreR` to support negatable `-W`-style
- review the toggle-group matched branch and improve it to support negatable `-W`-style
- improved CmdS.ensureXrefFlags to support new negatable-style (`-W`-style)
- add debug branch for `CmdS.FlagBy()` for debuggiing the longName not found case
- improved the report in toggle_group example
- add new params as `Negatable(b bool, items ...string)`
- added `cli.CommandBuilder.ToggleableFlags(group, items...)` for batch creating toggle-group flags
- fix `Flag.GetDottedNamePath()`
- fix expanding for desc, examples, header, footer, note, ...
- moved examples/*.go into examples/common to solve the cycle imports
- update all example apps codes
- remove some unused params
- remove unprocessed return values
- upgrade deps
- v2.1.15
- remove deprecated ref (/x/term)
- upgrade deps
- v2.1.12
- fix wrong dep in last release
- v2.1.11
- completed `generate shell` for autocompletion feature of supported shells
- completed `generate man` for manpages generating in deployment time
- added `App.GetRunner() Runner`
- fix unique worker and add shared app feature, added examples/shared/
- fix workerS.String()
- upgrade deps
- security patches
- v2.1.10
- fix a crash in printUsage() on a dyncmd object
- upgrade deps
- security patches
- v2.1.9
- fix `~~tree` printing the root command
- docs
- upgrade deps
- security patches
- v2.1.8
- cmdr: fix command indent (help screen)
- cmdr: remove `pkg/dir` since it moved into `hedzr/is`
- cmdr: update ref to hedzr/is/dir
- cmdr: mv `pkg/dir` into `hedzr/is`
- upgrade deps
- v2.1.7
- downgrade toolchain to go1.23.0
- upgrade deps
- cmdr: review & improve builtins commands and flags
- cmdr: add `OwnerIsRoot()`, `IsRoot()`
- cmdr: improved help screen
- cut overlong titles to a new line
- rename to `printCommandHeading()`, ...
- rename to `printFlagHeading()`, ...
- optimize the gap between short and long title if short is not a single char
- cut off aliases if titles width is greater than tabstop, and move them to the next line
- improved head-like flag, add a new line to remark it
- cmdr: improved head-like flag matching algor to search the parents commands if they own a head-like flag
- cmdr: change to `Flag.GetTitleFlagNamesBy(delimiter string, maxW...int) (title,rest string)`
- cmdr: change to `BaseOpt.GetTitleNames(maxWidth ...int) (title, rest string)`
- v2.1.6
- cmdr: fix calling `finalAction()` twice when redirectTo
- cmdr: fix modified state of peripheral object in store
- cmdr: fix external config file loading and write-back feature
- upgrade deps
- v2.1.5
- lots of improvements and fixes
- cmdr: add a pure `prompt` app (not a cmdr example)
- cmdr: fix unnecessary required flag in head_like.go
- cmdr: implements help-system (part 1)
- update local `SplitCommandString()`
- cmdr: update onAction, passing writer into builtin action handlers
- cmdr: fix helpScreenWriter/debugScreenWriter
- cmdr: relayout postProcess()/preProcess()
- update .vscode/launch.json
- upgrade deps
- v2.1.3
- lots of improvements and fixes
- cmdr: split `Painter` interface from `helpPrinter`
- cmdr: implements core algor for manpage output
- cmdr: implements `showHelpScreenAsMan()`
- cmdr: improve builtins commands
- cmdr: improve `showVersion()`
- cmdr: improve `showBuildInfo()`
- cmdr: add `StripOrderPrefix()`
- cmdr: add `PipeToReader()`
- cmdr: add `lite-app.json` for `examples/tiny/lite` app
- cmdr: load `app.json` and `.app.json` with internal tiny json loader
- cmdr: fix `EnsureTree()` call in `Build()` at first time
- v2.1.2
- lots of improvements and fixes
- fix dockerfile
- fix InvokeProc/InvokeShell
- fix `OnEvaluateSubCommandsFromConfig`
- added WithOnShowVersion, ...
- added conf.GitDesc, BuilderComment
- implements onPassThruCharMatched, ...
- implements onShowVersion, ...
- improved dyncmd (alias) feature
- cleanup
- v2.1.1
- lots of improvements and fixes
- add `.LeadingPlusSign()` to negatable testing
- fix litecmd.go to fit for `cli.Cmd`
- add `.OnEvaluateSubCommandsFromConfig()` to `jumpCmd` - for cmdr-tests/examples/concise app
- cmdr: fix `GetTitleNamesArrayMainly()` by prefered extracting name field
- cmdr: fix `GetTitleNamesArray()` by adding missed `shorts` titles
- cmdr: fix `CmdS.EqualTo()`
- cmdr: fix `BaseOpt.ShotTitle()`
- cmdr: add `OnEvaluateSubCommandsFromConfig()`
- cmdr: add `LeadingPlusSign()`
- fix CmdS. `AddSubCommand` & `AddFlag`
- cmdr: add `negatable` flag (auto `--no-XXX`)
- cmdr: improved `WithPeripherals(peripherals PeripheralMap)`
- cmdr: implement PresetCmdLines
- cmdr: implement InvokeProc and InvokeShell
- cmdr: fix checkValidArgs
- cmdr: fix checkRequired
- cmdr: exposed `InvokeProc/Shell/Shell/PresetCmdLines`
- cmdr: add `To()`
- cmdr: add Flag.`GetTriggerredTitle()` (=`GetHitStr()`)
- cmdr: add `ParsedState()`
- cmdr: add `TestStoreGetSectionFrom()`
- cmdr: add `OnAction` to `Creator`
- cmdr: add `DottedPathToCommandOrFlag()`
- cmdr: add `ActionDefault` to `ActionEnum`
- fixed/improved `CmdS.SubCmdBy()/FlagBy()` Hedzr
- improved examples/
- add examples/cmd/preset-cmdline.go
- add examples/cmd/invoke.go
- add example app: valid-args
- add example app: required
- add example app: external-editor
- upgrade deps
- security patches
- v2.1.0
- upgrade toolchain to go1.23.7
- lots of improvements and fixes
- fix typo in doc of `WithBuilders`
- fix test definition
- fix `Shorts()` returned unique items
- exposed more package-level functions
- add test `TestBaseOpt_GetDottedPath`
- more walk functions
- some subtests for parsing duration, parse int,float,complex, ...
- make ActionEnum constants public too
- make `dottedPathToCommandOrFlagG` public (as `DottedPathToCommandOrFlag(dottedPath)`
- cmdr: define group name constants
- cmdr: add `Error` and `Recycle()` to `Runner`
- cmdr: add `DoBuiltinAction` to `Runner`
- cmdr: add App.OnAction
- cmdr: help-screen: fix the right part alignment
- cmdr: help-screen: fix no `Flags:` title when a cmd owns all hidden flags
- cmdr: help-screen: fix no `Commands:` title when a cmd owns all hidden subcmds
- cmdr: help-screen: improved display style of required flag, valid-args flag
- cmdr: help-screen: improved display style of header line
- cmdr: help-screen: improved display style of head-like flag
- cmdr: help-screen: improved display style if a flag has no short title
- cmdr: toggle-group: fix to update into Stpre when matched
- cmdr: toggle-group: fix to update default matched value
- cmdr: help-screen: improved display style of redirect-to command
- cmdr: help-screen: improved display style of required flag
- cmdr: help-screen: improved display style of required flag, valid-args flag
- cmdr: process `TransferIntoStore` interface to support default toggle-group value, and other cases for future
- cmdr: defined constant `cli.CommandsStoreKey` = "app.cmd"
- cmdr: builder: fix addCommand - avoid loop ref by insert itself as a child
- cmdr: builder: added WithOpts(opts...)
- cmdr: builder: added `RootBuilder(func(cli.CommandBuilder))`
- cmdr: added `cmdr.Create(...)` for creating a new app, a replacement for `New()`
- added CmdS/Cmd.`IsDynamicCommandsLoading()` & `IsDynamicFlagsLoading()`
- improved OnEvalSubcommands `Info` log line to `Verbose`
- improved Flag.SetEnvVars to ignore empty string
- improved godoc for flagbuilder.go
- improved godoc for `RedirectTo`...
- cli/worker: builtins: `help` command, removed `usage` alias name
- cli/worker: builtins: `version-sim` command, removed `version-simulate` alias name
- cli: added `CmdAdder` interface
- cli: added `SubCmdBy(longName)` and `FlagBy(longName)` to find them by title
- CmdS: exclude duplicated insertion
- predefined envvars: added `$EXE`, `$EXE_DIR`
- move out cli/examples to top level
- help-screen: record last group name to improve printing list (esp for some hidden items at first of a group)
- help-screen: expand env vars for the strings
- help-screen: colLeftTabbedWidth 56 -> 46, decrease it
- help-screen: added `printNotes()`, in printing redirect-to feature
- builder: Info(): added some blank lines
- other fixes and improvements
- more docs
- more examples
- remove unused file and cleanup
- upgrade deps
- security patch
- v2.0.17
- upgrade deps
- security patch
- v2.0.16
- upgrade deps
- security patch
- v2.0.15
- upgrade deps
- security patch
- v2.0.13
- upgrade deps
- security patch
- fixed ext file location moved
- added TasksParsed and TasksPostCleanup
- v2.0.11
- upgrade deps
- bugs fixed
- safe guard while cmdr not parsed
- v2.0.10
- upgrade deps
- bugs fixed
- safer api (ParsedState) even if cmdr.Run not invoked yet
- v2.0.10
- security patches
- bugs fixed
- improved `Description(...)`, `Examples(...)`
- shorten default tail-line
- update litecmd.go
- v2.0.9
- security patches
- bugs fixed
- uniform Store() & CmdStore() apis: `Set()` and `Store()`
- change `loader.Load`
- removed `exec` subpackage since it had been removed to `hedzr/is`
- fix bindOpts to detect user's Args via `WithArgs(...)`
- prevent internal jsonLoaderS's file not exists error
- fixed `ForFileMax` to return errors
- update tiny app / sample codes
- add `LoadedSources`
- add `VarLogDir`
- fix `VarRunDir`
- add `app.SetDesc()`
- add `app.Description()`
- add auto-env-vars-bindings feature
- fix building on windows
- v2.0.8
- fixed help screen, the missing envvars list
- fixed dirs.VarRunDir, ...
- fixed dyn-commands
- v2.0.7
- update deps
- security patches
- bugs fixed
- new features added
- v2.0.5
- update deps
- security patches
- v2.0.3
- split loaders as a standalone repo
- split examples and tests to standalone
- update deps
- fix bugs
- v2.0.2
- remove dep to loaders/, this will reduce more 3rd-party libs deps from main module
- more tunes for APIs
- v2.0.1
- fix/improve map -> struct, from hedzr/store
- more tests, more docs
- slight corrections
- v2.0.0
initial commit
- integrated with store.Store
- preProcess, parse, and exec
- help screen, external editor, try parse value, atoa subpackage
- mutual exclusive, just once, prerequisites, circuit break
- sbom, --config, debug info screen
a (string) to any (type) - To convert a string to an exact value according to the given meme.