Skip to content

Commit

Permalink
Update readme (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-zherikov authored Oct 17, 2021
1 parent b925eb0 commit 80e850d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@ assert(parseCLIKnownArgs!T(args).get == T("A"));
assert(args == ["-c", "C"]);
```

#### Wrappers for main function

`argparse` offers two mixins for convenience that one can use to wrap custom main function that accepts parameter object
instead of raw command line in the form of `string[]`:
- `Main.parseCLIKnownArgs(TYPE, alias newMain, Config config = Config.init)`
- `Main.parseCLIArgs(TYPE, alias newMain, Config config = Config.init)`

They define standard `main` function that calls
corresponding parsing function for arguments in `TYPE` type providing `newMain` callback that is called upon successful parsing.

### Positional arguments

Expand Down

0 comments on commit 80e850d

Please sign in to comment.