mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
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:
parent
4320f8641b
commit
c0fec31bef
9 changed files with 69 additions and 13 deletions
|
@ -341,8 +341,7 @@ fn (cmd Command) check_version_flag() {
|
|||
if cmd.defaults.parsed.version.flag && cmd.version != '' && cmd.flags.contains('version') {
|
||||
version_flag := cmd.flags.get_bool('version') or { return } // ignore error and handle command normally
|
||||
if version_flag {
|
||||
version_cmd := cmd.commands.get('version') or { return } // ignore error and handle command normally
|
||||
version_cmd.execute(version_cmd) or { panic(err) }
|
||||
print_version_for_command(cmd) or { panic(err) }
|
||||
exit(0)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue