From eb7a75dca6360957399c06d1c93aa049674fc154 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 19 Jul 2018 14:13:29 +0200 Subject: [PATCH] Adding better info on INI files --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1279fe0b..fcc3e83f 100644 --- a/README.md +++ b/README.md @@ -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