Commit eb7a75dca6360957399c06d1c93aa049674fc154

Authored by Henry Schreiner
Committed by GitHub
1 parent a3eb8cc2

Adding better info on INI files

Showing 1 changed file with 5 additions and 2 deletions
README.md
@@ -284,14 +284,17 @@ If this is called with no arguments, it will remove the configuration file optio @@ -284,14 +284,17 @@ If this is called with no arguments, it will remove the configuration file optio
284 value = 1 284 value = 1
285 str = "A string" 285 str = "A string"
286 vector = 1 2 3 286 vector = 1 2 3
  287 +str_vector = "one" "two" "and three"
287 288
288 -; Section map to subcommands 289 +; Sections map to subcommands
289 [subcommand] 290 [subcommand]
290 in_subcommand = Wow 291 in_subcommand = Wow
291 sub.subcommand = true 292 sub.subcommand = true
292 ``` 293 ```
293 294
294 -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 295 +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.
  296 +
  297 +To print a configuration file from the passed
295 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. 298 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.
296 299
297 ## Inheriting defaults 300 ## Inheriting defaults