mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 07:04:39 +00:00
Update README.md
This commit is contained in:
parent
f6f9b0302d
commit
a385d78919
19
README.md
19
README.md
@ -1,5 +1,24 @@
|
||||
# Argument Parser
|
||||
|
||||
## Positional Arguments
|
||||
|
||||
```cpp
|
||||
#include <argparse.hpp>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
argparse::ArgumentParser program("main");
|
||||
|
||||
program.add_argument("input");
|
||||
program.add_argument("output");
|
||||
|
||||
program.parse(argc, argv);
|
||||
std::string input = program.get("input");
|
||||
std::string output = program.get("output");
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## Optional Arguments
|
||||
|
||||
```cpp
|
||||
|
Loading…
Reference in New Issue
Block a user