1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-05 06:33:52 +00:00

Adding better info on INI files

This commit is contained in:
Henry Schreiner 2018-07-19 14:13:29 +02:00 committed by GitHub
parent a3eb8cc232
commit eb7a75dca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,14 +284,17 @@ If this is called with no arguments, it will remove the configuration file optio
value = 1
str = "A string"
vector = 1 2 3
str_vector = "one" "two" "and three"
; Section map to subcommands
; Sections map to subcommands
[subcommand]
in_subcommand = Wow
sub.subcommand = true
```
Spaces before and after the name and argument are ignored. Multiple arguments are separated by spaces. One set of quotes will be removed, preserving spaces (the same way the command line works). Boolean options can be `true`, `on`, `1`, `yes`; or `false`, `off`, `0`, `no` (case insensitive). Sections (and `.` separated names) are treated as subcommands (note: this does not mean that subcommand was passed, it just sets the "defaults". To print a configuration file from the passed
Spaces before and after the name and argument are ignored. Multiple arguments are separated by spaces. One set of quotes will be removed, preserving spaces (the same way the command line works). Boolean options can be `true`, `on`, `1`, `yes`; or `false`, `off`, `0`, `no` (case insensitive). Sections (and `.` separated names) are treated as subcommands (note: this does not mean that subcommand was passed, it just sets the "defaults". You cannot set positional-only arguments or force subcommands to be present in the command line.
To print a configuration file from the passed
arguments, use `.config_to_str(default_also=false, prefix="", write_description=false)`, where `default_also` will also show any defaulted arguments, `prefix` will add a prefix, and `write_description` will include option descriptions.
## Inheriting defaults