From 4b70b352c24d0abae2bf03dd8e2a39464a296720 Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Thu, 3 Jun 2021 00:38:55 +0200 Subject: [PATCH] Readme.md --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 67573e3..4748ce5 100644 --- a/readme.md +++ b/readme.md @@ -85,7 +85,7 @@ int main(int argc, char** argv) // Either check via HasParam(), or do a try-catch try { - int myInt = args["--my-int"].GetInt32(); + int myInt = args["--my-int"].GetInt32(); double myInt = args["--my-float"].GetFloat32(); std::string myStr = args["--my-string"].GetString(); } @@ -184,7 +184,7 @@ These conversions are: * float ->[int, string, list] * string -> [list], -The conversions 'to list' just create a list with a single entry. +The conversions 'to-list' just create a list with a single entry. Minimal working example: ```cpp @@ -196,7 +196,7 @@ int main(int argc, char** argv) // Register constraints args.RegisterConstraints({ - ParamConstraint::TypeSafety("--this-must-be-int", DATA_TYPE::INT) + ParamConstraint::TypeSafety("--this-must-be-int", DATA_TYPE::INT) }); // Parse @@ -210,7 +210,7 @@ If it was passed, for example, as a string, it would throw an exception. --- Note that you can also combine these two constraint-types by populating the struct yourself: -``` +```cpp ParamConstraint pc; pc.key = "--my-key"; pc.constrainType = true;