Bond
 
Loading...
Searching...
No Matches
cmdargs.h
1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#pragma once
5
6#include <bond/core/config.h>
7
8#include "bond.h"
9#include "detail/cmdargs.h"
10
11namespace bond
12{
13namespace cmd
14{
15 // Output usage help to std::cerr
16 template <typename Options>
17 void ShowUsage(const char* program)
18 {
19 Options options;
20 Apply(detail::Usage(program), options);
21 }
22
23 // Read command line arguments
24 template <typename Options>
25 Options GetArgs(int argc, char** argv, bool partial = false)
26 {
27 Options options;
28 Apply(detail::CmdArg(argc, argv, partial), options);
29 return options;
30 }
31}
32
33}
namespace bond
Definition: apply.h:17