cli: fix default flags when their command equivalents are disabled (#21469)

* always replace `\r\n` with `\n`

* fix

* test

* cleanup

* add doc comment
This commit is contained in:
Turiiya 2024-05-08 13:11:40 +02:00 committed by GitHub
parent 4320f8641b
commit c0fec31bef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 69 additions and 13 deletions

View file

@ -0,0 +1,11 @@
import cli { Command, CommandFlag }
fn main() {
mut cmd := Command{
name: 'foo'
defaults: struct {
help: CommandFlag{false, true}
}
}
cmd.parse(['foo', '-help'])
}