Francis Bouvier
31ef5246bc
Add per-subcommand help via help or --help argument
...
`lightpanda <subcommand> help`, `lightpanda <subcommand> --help`
now print only the relevant subcommand options plus common options,
instead of the full text.
`lightpanda help <subcommand>` is also supported
(and that's what use internally).
2026-05-11 22:16:52 +02:00
Halil Durak
604210fd8b
cli: introduce variants
...
Also refactors parsing by moving value parsing functionality to `parseValue` function.
2026-04-27 16:05:40 +03:00
Karl Seguin
945e9597bf
Propagate CLI parsing errors
...
Rather than continue on a failed argument parse, propagate the error so that
the program eventually exists.
2026-04-27 08:48:30 +08:00
Adrià Arrufat
6a65801527
cli: allow optional positional arguments in command builder
2026-04-24 13:08:40 +02:00
Karl Seguin
6ca9208260
Default command 'serve' for backwards compatibility
2026-04-23 17:31:25 +08:00
Halil Durak
fa302a1db1
cli: report failure on lightpanda serve serve case
2026-04-22 16:37:37 +03:00
Halil Durak
1022875234
cli: improve failure messages
2026-04-22 16:08:15 +03:00
Halil Durak
59afb9e773
cli: --strip -> --strip-mode in sniff and doc-comment
2026-04-22 16:08:15 +03:00
Halil Durak
77a494f1fb
cli: update doc-comment
2026-04-22 16:08:15 +03:00
Halil Durak
79319485ea
cli: catch unknown arguments on options that take packed struct
2026-04-22 16:08:14 +03:00
Halil Durak
3619af2d4c
cli: reintroduce old --help
2026-04-22 16:08:14 +03:00
Halil Durak
44849fdaf3
cli: splitScalar -> tokenizeScalar
2026-04-22 16:08:14 +03:00
Halil Durak
baf97bb607
cli: remove shortcut bits in sniffCommand
2026-04-22 16:08:13 +03:00
Halil Durak
7acbd54172
cli: accept defaults for boolean
...
Setting a boolean option, instead of setting it to `true`, prefers the opposite of `default`. The `default` is `false` if not provided.
2026-04-22 16:08:13 +03:00
Halil Durak
4a4e3643f5
cli: prefer full over all to enable everything
2026-04-22 16:08:12 +03:00
Halil Durak
012fe40bb5
cli: remove aliases and shortcuts
2026-04-22 16:08:12 +03:00
Halil Durak
74a518c56f
cli: reintroduce command sniffing
2026-04-22 16:07:04 +03:00
Halil Durak
07351f0e40
cli: add an explanatory doc-comment that goes in depth of the API
2026-04-22 16:07:04 +03:00
Halil Durak
baa0d83fa7
cli: positional argument must not be null after parsing
2026-04-22 16:07:03 +03:00
Halil Durak
059d21f7fd
cli: return errors if next argument not found
2026-04-22 16:07:03 +03:00
Halil Durak
1a68ea7370
cli: better handle unknown arguments
2026-04-22 16:07:02 +03:00
Halil Durak
10914d6288
cli: fix --log-filter-scopes regression
2026-04-22 16:07:02 +03:00
Halil Durak
b01e93502e
cli: revert enum specific peek ahead logic
...
This was needed before the introduction of `validator`; doesn't make sense now.
2026-04-22 16:07:01 +03:00
Halil Durak
56b6fbe011
cli: many improvements
...
* Options with optional types are introduced to null by default
* Options with boolean types cannot be optional (nullable)
* Options with boolean types are introduced with false by default
* introduce shortcuts for options that can be provided via single dash
* introduce validators; custom parsing logic can be inserted for niche cases
2026-04-22 16:07:01 +03:00
Halil Durak
9bf85214e3
cli: add support for command aliases and shared options
2026-04-22 16:03:18 +03:00