@@ -54,6 +54,9 @@ namespace docopt {
54
54
55
55
// Arguments contained '--version' and parsing was aborted early
56
56
struct DocoptExitVersion : std::runtime_error { DocoptExitVersion() : std::runtime_error(" Docopt --version argument encountered" ) {} };
57
+
58
+ // / A map of options set by the user
59
+ using options = std::map<std::string, value>;
57
60
58
61
// / Parse user options from the given option string.
59
62
// /
@@ -68,7 +71,7 @@ namespace docopt {
68
71
// / @throws DocoptExitHelp if 'help' is true and the user has passed the '--help' argument
69
72
// / @throws DocoptExitVersion if 'version' is true and the user has passed the '--version' argument
70
73
// / @throws DocoptArgumentError if the user's argv did not match the usage patterns
71
- std::map<std::string, value> DOCOPT_API docopt_parse (std::string const & doc,
74
+ options DOCOPT_API docopt_parse (std::string const & doc,
72
75
std::vector<std::string> const & argv,
73
76
bool help = true ,
74
77
bool version = true ,
@@ -81,7 +84,7 @@ namespace docopt {
81
84
// / * DocoptExitHelp - print usage string and terminate (with exit code 0)
82
85
// / * DocoptExitVersion - print version and terminate (with exit code 0)
83
86
// / * DocoptArgumentError - print error and usage string and terminate (with exit code -1)
84
- std::map<std::string, value> DOCOPT_API docopt (std::string const & doc,
87
+ options DOCOPT_API docopt (std::string const & doc,
85
88
std::vector<std::string> const & argv,
86
89
bool help = true ,
87
90
std::string const & version = {},
0 commit comments