webrtc-streamer 0.8.13 → 0.8.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,31 +31,46 @@ Experimentation to stream WebRTC media sources like capture devices, screen capt
31
31
  ## Usage
32
32
 
33
33
  ```roff
34
- ./webrtc-streamer [-H http port] [-S[embeded stun address]] -[v[v]] [urls...]
35
- ./webrtc-streamer [-H http port] [-s[external stun address]] -[v[v]] [urls...]
36
- ./webrtc-streamer -V
37
- -v[v[v]] : verbosity
38
- -V : print version
39
- -C config.json : load urls from JSON config file
40
- -n name -u videourl -U audiourl : register a name for a video url and an audio url
41
- [url] : url to register in the source list
42
-
43
- -H [hostname:]port : HTTP server binding (default 0.0.0.0:8000)
44
- -w webroot : path to get files
45
- -c sslkeycert : path to private key and certificate for HTTPS
46
- -N nbthreads : number of threads for HTTP server
47
- -A passwd : password file for HTTP server access
48
- -D authDomain : authentication domain for HTTP server access (default:mydomain.com)
49
-
50
- -S[stun_address] : start embeded STUN server bind to address (default 0.0.0.0:3478)
51
- -s[stun_address] : use an external STUN server (default:stun.l.google.com:19302 , -:means no STUN)
52
- -T[username:password@]turn_address : start embeded TURN server (default:disabled)
53
- -t[username:password@]turn_address : use an external TURN relay server (default:disabled)
54
- -R [Udp port range min:max] : Set the webrtc udp port range (default 0:65535)
55
- -W webrtc_trials_fields : Set the webrtc trials fields (default:WebRTC-FrameDropper/Disabled/)
56
- -a[audio layer] : spefify audio capture layer to use (default:0)
57
- -q[filter] : spefify publish filter (default:.*)
58
- -o : use null codec (keep frame encoded)
34
+ Usage:
35
+ ./webrtc-streamer [OPTION...] [urls...]
36
+
37
+ General options:
38
+ -h, --help Print help
39
+ -V, --version Print version
40
+ -v, --verbose Verbosity level (use multiple times for more verbosity)
41
+ -C, --config arg Load urls from JSON config file
42
+ -n, --name arg Register a stream with name
43
+ -u, --video arg Video URL for the named stream
44
+ -U, --audio arg Audio URL for the named stream
45
+
46
+ HTTP options:
47
+ -H, --http arg HTTP server binding (default 0.0.0.0:8000)
48
+ -w, --webroot arg Path to get static files
49
+ -c, --cert arg Path to private key and certificate for HTTPS
50
+ -N, --threads arg Number of threads for HTTP server
51
+ -A, --passwd arg Password file for HTTP server access
52
+ -D, --domain arg Authentication domain for HTTP server access
53
+ (default:mydomain.com)
54
+ -X, --disable-xframe Disable X-Frame-Options header
55
+ -B, --base-path arg Base path for HTTP server
56
+
57
+ WebRTC options:
58
+ -m, --maxpc arg Maximum number of peer connections
59
+ -I, --ice-transport arg Set ice transport type
60
+ -T, --turn-server [=arg(=turn:turn@0.0.0.0:3478)]
61
+ Start embedded TURN server
62
+ -t, --turn arg Use an external TURN relay server
63
+ -S, --stun-server [=arg(=0.0.0.0:3478)]
64
+ Start embedded STUN server bind to address
65
+ -s, --stun [=arg(=0.0.0.0:3478)]
66
+ Use an external STUN server
67
+ -R, --udp-range arg Set the webrtc udp port range
68
+ -W, --trials arg Set the webrtc trials fields
69
+ -a, --audio-layer [=arg(=)] Specify audio capture layer to use (omit
70
+ value for dummy audio)
71
+ -q, --publish-filter arg Specify publish filter
72
+ -o, --null-codec Use null codec (keep frame encoded)
73
+ -b, --plan-b Use sdp plan-B (default use unifiedPlan)
59
74
  ```
60
75
 
61
76
  Arguments of '-H' are forwarded to option
@@ -155,9 +170,9 @@ and [TURN](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT)
155
170
  server and publish its URL:
156
171
 
157
172
  ```sh
158
- ./webrtc-streamer -S0.0.0.0:3478 -s$(curl -s ifconfig.me):3478
159
- ./webrtc-streamer -s- -T0.0.0.0:3478 -tturn:turn@$(curl -s ifconfig.me):3478
160
- ./webrtc-streamer -S0.0.0.0:3478 -s$(curl -s ifconfig.me):3478 -T0.0.0.0:3479 -tturn:turn@$(curl -s ifconfig.me):3479
173
+ ./webrtc-streamer --stun-server=0.0.0.0:3478 --stun=$(curl -s ifconfig.me):3478
174
+ ./webrtc-streamer --stun=- --turn-server=0.0.0.0:3478 -tturn:turn@$(curl -s ifconfig.me):3478
175
+ ./webrtc-streamer --stun-server=0.0.0.0:3478 --stun=$(curl -s ifconfig.me):3478 --turn-server=0.0.0.0:3479 --turn=turn:turn@$(curl -s ifconfig.me):3479
161
176
  ```
162
177
 
163
178
  The command `curl -s ifconfig.me` is getting the public IP, it could also given
@@ -0,0 +1,16 @@
1
+ load("@rules_cc//cc:defs.bzl", "cc_library")
2
+
3
+ cc_library(
4
+ name = "cxxopts",
5
+ hdrs = ["include/cxxopts.hpp"],
6
+ strip_include_prefix = "include",
7
+ visibility = ["//visibility:public"],
8
+ )
9
+
10
+ load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
11
+
12
+ cc_fuzz_test(
13
+ name = "cxxopts_fuzz_test",
14
+ srcs = ["test/fuzz.cpp"],
15
+ deps = [":cxxopts"],
16
+ )
@@ -0,0 +1,183 @@
1
+ # Changelog
2
+
3
+ This is the changelog for `cxxopts`, a C++11 library for parsing command line
4
+ options. The project adheres to semantic versioning.
5
+
6
+ ## 3.3.1
7
+
8
+ ### Bug fixes
9
+
10
+ * Added missing version bump
11
+
12
+ ## 3.3.0
13
+
14
+ ### Bug fixes
15
+
16
+ * Added missing header for GCC 15
17
+ * Fix some CMake packaging problems
18
+
19
+ ### Added
20
+
21
+ * `as_optional`
22
+ * `ParseResult::contains`
23
+ * `std::filesystem` support
24
+ * CMake 4 compatibility
25
+
26
+ ## 3.2.1
27
+
28
+ ### Bug fixes
29
+
30
+ * Fix compilation with optional on C++20.
31
+
32
+ ## 3.2
33
+
34
+ ### Bug fixes
35
+
36
+ * Fix unannotated fallthrough.
37
+ * Fix sign conversion with Unicode output.
38
+ * Don't initialize regex in static initialiser.
39
+ * Fix incorrect integer overflow checks.
40
+
41
+ ### Added
42
+
43
+ * Add fuzzing to CI
44
+
45
+ ### Changed
46
+
47
+ * Change quote output to '' to match Windows.
48
+ * Don't split positional arguments by the list delimiter.
49
+ * Order help groups by the order they were added.
50
+
51
+ ## 3.1.1
52
+
53
+ ### Bug Fixes
54
+
55
+ * Fixed version number in header.
56
+ * Fixed cast warning in Unicode function.
57
+
58
+ ## 3.1
59
+
60
+ ### Added
61
+
62
+ * Support for multiple long names for the same option (= multiple long aliases)
63
+ * Add a `program()` function to retrieve the program name.
64
+ * Added a .clang-format file.
65
+ * Added iterator and printing for a ParseResult.
66
+
67
+ ### Changed
68
+
69
+ * Cleanup exception code, add cxxopts::exceptions namespace.
70
+ * Renamed several exceptions to be more descriptive, and added to a nested namespace.
71
+
72
+ ### Bug Fixes
73
+
74
+ * Fix `arguments()` having no key for options that only have a short name.
75
+
76
+ ## 3.0
77
+
78
+ ### Changed
79
+
80
+ * Only search for a C++ compiler in CMakeLists.txt.
81
+ * Allow for exceptions to be disabled.
82
+ * Fix duplicate default options when there is a short and long option.
83
+ * Add `CXXOPTS_NO_EXCEPTIONS` to disable exceptions.
84
+ * Fix char parsing for space and check for length.
85
+ * Change argument type in `Options::parse` from `char**` to `const char**`.
86
+ * Refactor parser to not change its arguments.
87
+ * `ParseResult` doesn't depend on a reference to the parser.
88
+ * Fixed several warnings and code quality issues.
89
+ * Improved formatting for help descriptions.
90
+ * Improve integer parsing.
91
+
92
+ ### Added
93
+
94
+ * A list of unmatched arguments is available in `ParseResult`.
95
+ * Support single letter options with argument attached.
96
+ * Use <optional> if it is present.
97
+
98
+ ### Bug Fixes
99
+
100
+ * Fix missing option name in exception.
101
+
102
+ ## 2.2
103
+
104
+ ### Changed
105
+
106
+ * Allow integers to have leading zeroes.
107
+ * Build the tests by default.
108
+ * Don't check for container when showing positional help.
109
+
110
+ ### Added
111
+
112
+ * Iterator inputs to `parse_positional`.
113
+ * Throw an exception if the option in `parse_positional` doesn't exist.
114
+ * Parse a delimited list in a single argument for vector options.
115
+ * Add an option to disable implicit value on booleans.
116
+
117
+ ### Bug Fixes
118
+
119
+ * Fix a warning about possible loss of data.
120
+ * Fix version numbering in CMakeLists.txt
121
+ * Remove unused declaration of the undefined `ParseResult::get_option`.
122
+ * Throw on invalid option syntax when beginning with a `-`.
123
+ * Throw in `as` when option wasn't present.
124
+ * Fix catching exceptions by reference.
125
+ * Fix out of bounds errors parsing integers.
126
+
127
+ ## 2.1.1
128
+
129
+ ### Bug Fixes
130
+
131
+ * Revert the change adding `const` type for `argv`, because most users expect
132
+ to pass a non-const `argv` from `main`.
133
+
134
+ ## 2.1
135
+
136
+ ### Changed
137
+
138
+ * Options with implicit arguments now require the `--option=value` form if
139
+ they are to be specified with an option. This is to remove the ambiguity
140
+ when a positional argument could follow an option with an implicit value.
141
+ For example, `--foo value`, where `foo` has an implicit value, will be
142
+ parsed as `--foo=implicit` and a positional argument `value`.
143
+ * Boolean values are no longer special, but are just an option with a default
144
+ and implicit value.
145
+
146
+ ### Added
147
+
148
+ * Added support for `std::optional` as a storage type.
149
+ * Allow the help string to be customised.
150
+ * Use `const` for the type in the `argv` parameter, since the contents of the
151
+ arguments is never modified.
152
+
153
+ ### Bug Fixes
154
+
155
+ * Building against GCC 4.9 was broken due to overly strict shadow warnings.
156
+ * Fixed an ambiguous overload in the `parse_positional` function when an
157
+ `initializer_list` was directly passed.
158
+ * Fixed precedence in the Boolean value regex.
159
+
160
+ ## 2.0
161
+
162
+ ### Changed
163
+
164
+ * `Options::parse` returns a ParseResult rather than storing the parse
165
+ result internally.
166
+ * Options with default values now get counted as appearing once if they
167
+ were not specified by the user.
168
+
169
+ ### Added
170
+
171
+ * A new `ParseResult` object that is the immutable result of parsing. It
172
+ responds to the same `count` and `operator[]` as `Options` of 1.x did.
173
+ * The function `ParseResult::arguments` returns a vector of the parsed
174
+ arguments to iterate through in the order they were provided.
175
+ * The symbol `cxxopts::version` for the version of the library.
176
+ * Booleans can be specified with various strings and explicitly set false.
177
+
178
+ ## 1.x
179
+
180
+ The 1.x series was the first major version of the library, with release numbers
181
+ starting to follow semantic versioning, after 0.x being unstable. It never had
182
+ a changelog maintained for it. Releases mostly contained bug fixes, with the
183
+ occasional feature added.
@@ -0,0 +1,46 @@
1
+ == System installation ==
2
+
3
+ This library is header only. So you can either copy `include/cxxopts.hpp` to `/usr/include` or `/usr/local/include`, or add `include` to your search path.
4
+
5
+ == Building the examples and tests ==
6
+
7
+ It is preferable to build out of source. Make a build directory somewhere, and then
8
+ do the following, where `${CXXOPTS_DIR}` is the path that you checked out `cxxopts`
9
+ to:
10
+
11
+ cmake ${CXXOPTS_DIR}
12
+ make
13
+
14
+ You can use another build tool, such as ninja.
15
+
16
+ cmake -G Ninja ${CXXOPTS_DIR}
17
+ ninja
18
+
19
+
20
+ To run the tests, you have to configure `cxxopts` with another flag:
21
+ cmake -D CXXOPTS_BUILD_TESTS=On ${CXXOPTS_DIR}
22
+ make
23
+ make test
24
+
25
+ == Using cxxopts in tipi.build projects ==
26
+
27
+ `cxxopts` can be easily used in [tipi.build](https://tipi.build) projects simply by adding the following entry to your `.tipi/deps`:
28
+
29
+ ```json
30
+ {
31
+ "jarro2783/cxxopts": { "@": "v3.0.0" }
32
+ }
33
+ ```
34
+
35
+ To try this you can run the following command in `/src` (change the target name appropriately to `linux` or `macos` or `windows`):
36
+
37
+ ```bash
38
+ tipi . -t <target>
39
+ ./build/linux-cxx17/bin/test_package -v
40
+ ```
41
+
42
+ To develop `cxxopts` using tipi run the following command at the root of the repository:
43
+
44
+ ```bash
45
+ tipi . -t <target> --test all -v
46
+ ```
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2014 Jarryd Beck
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,289 @@
1
+ [![Build Status](https://travis-ci.org/jarro2783/cxxopts.svg?branch=master)](https://travis-ci.org/jarro2783/cxxopts)
2
+
3
+ # Release versions
4
+
5
+ Note that `master` is generally a work in progress, and you probably want to use a
6
+ tagged release version.
7
+
8
+ ## Version 3 breaking changes
9
+
10
+ If you have used version 2, there are a couple of breaking changes in version 3
11
+ that you should be aware of. If you are new to `cxxopts` you can skip this
12
+ section.
13
+
14
+ The parser no longer modifies its arguments, so you can pass a const `argc` and
15
+ `argv` and expect them not to be changed.
16
+
17
+ The `ParseResult` object no longer depends on the parser. So it can be returned
18
+ from a scope outside the parser and still work. Now that the inputs are not
19
+ modified, `ParseResult` stores a list of the unmatched arguments. These are
20
+ retrieved like follows:
21
+
22
+ ```cpp
23
+ auto result = options.parse(argc, argv);
24
+ result.unmatched(); // get the unmatched arguments
25
+ ```
26
+
27
+ # Quick start
28
+
29
+ This is a lightweight C++ option parser library, supporting the standard GNU
30
+ style syntax for options.
31
+
32
+ Options can be given as:
33
+
34
+ --long
35
+ --long=argument
36
+ --long argument
37
+ -a
38
+ -ab
39
+ -abc argument
40
+
41
+ where c takes an argument, but a and b do not.
42
+
43
+ Additionally, anything after `--` will be parsed as a positional argument.
44
+
45
+ ## Basics
46
+
47
+ ```cpp
48
+ #include <cxxopts.hpp>
49
+ ```
50
+
51
+ Create a `cxxopts::Options` instance.
52
+
53
+ ```cpp
54
+ cxxopts::Options options("MyProgram", "One line description of MyProgram");
55
+ ```
56
+
57
+ Then use `add_options`.
58
+
59
+ ```cpp
60
+ options.add_options()
61
+ ("d,debug", "Enable debugging") // a bool parameter
62
+ ("i,integer", "Int param", cxxopts::value<int>())
63
+ ("f,file", "File name", cxxopts::value<std::string>())
64
+ ("v,verbose", "Verbose output", cxxopts::value<bool>()->default_value("false"))
65
+ ;
66
+ ```
67
+
68
+ Options are declared with a long and an optional short option. A description
69
+ must be provided. The third argument is the value, if omitted it is boolean.
70
+ Any type can be given as long as it can be parsed, with operator>>.
71
+
72
+ To parse the command line do:
73
+
74
+ ```cpp
75
+ auto result = options.parse(argc, argv);
76
+ ```
77
+
78
+ To retrieve an option use `result.count("option")` to get the number of times
79
+ it appeared, and
80
+
81
+ ```cpp
82
+ result["opt"].as<type>()
83
+ ```
84
+
85
+ to get its value. If "opt" doesn't exist, or isn't of the right type, then an
86
+ exception will be thrown.
87
+
88
+ ## Unrecognised arguments
89
+
90
+ You can allow unrecognised arguments to be skipped. This applies to both
91
+ positional arguments that are not parsed into another option, and `--`
92
+ arguments that do not match an argument that you specify. This is done by
93
+ calling:
94
+
95
+ ```cpp
96
+ options.allow_unrecognised_options();
97
+ ```
98
+
99
+ and in the result object they are retrieved with:
100
+
101
+ ```cpp
102
+ result.unmatched()
103
+ ```
104
+
105
+ ## Exceptions
106
+
107
+ Exceptional situations throw C++ exceptions. There are two types of
108
+ exceptions: errors defining the options, and errors when parsing a list of
109
+ arguments. All exceptions derive from `cxxopts::exceptions::exception`. Errors
110
+ defining options derive from `cxxopts::exceptions::specification` and errors
111
+ parsing arguments derive from `cxxopts::exceptions::parsing`.
112
+
113
+ All exceptions define a `what()` function to get a printable string
114
+ explaining the error.
115
+
116
+ ## Help groups
117
+
118
+ Options can be placed into groups for the purposes of displaying help messages.
119
+ To place options in a group, pass the group as a string to `add_options`. Then,
120
+ when displaying the help, pass the groups that you would like displayed as a
121
+ vector to the `help` function.
122
+
123
+ ## Positional Arguments
124
+
125
+ Positional arguments are those given without a preceding flag and can be used
126
+ alongside non-positional arguments. There may be multiple positional arguments,
127
+ and the final positional argument may be a container type to hold a list of all
128
+ remaining positionals.
129
+
130
+ To set up positional arguments, first declare the options, then configure a
131
+ set of those arguments as positional like:
132
+
133
+ ```cpp
134
+ options.add_options()
135
+ ("script", "The script file to execute", cxxopts::value<std::string>())
136
+ ("server", "The server to execute on", cxxopts::value<std::string>())
137
+ ("filenames", "The filename(s) to process", cxxopts::value<std::vector<std::string>>());
138
+
139
+ options.parse_positional({"script", "server", "filenames"});
140
+
141
+ // Parse options the usual way
142
+ options.parse(argc, argv);
143
+ ```
144
+
145
+ For example, parsing the following arguments:
146
+ ~~~
147
+ my_script.py my_server.com file1.txt file2.txt file3.txt
148
+ ~~~
149
+ will result in parsed arguments like the following table:
150
+
151
+ | Field | Value |
152
+ | ------------- | ----------------------------------------- |
153
+ | `"script"` | `"my_script.py"` |
154
+ | `"server"` | `"my_server.com"` |
155
+ | `"filenames"` | `{"file1.txt", "file2.txt", "file3.txt"}` |
156
+
157
+ ## Default and implicit values
158
+
159
+ An option can be declared with a default or an implicit value, or both.
160
+
161
+ A default value is the value that an option takes when it is not specified
162
+ on the command line. The following specifies a default value for an option:
163
+
164
+ ```cpp
165
+ cxxopts::value<std::string>()->default_value("value")
166
+ ```
167
+
168
+ An implicit value is the value that an option takes when it is given on the
169
+ command line without an argument. The following specifies an implicit value:
170
+
171
+ ```cpp
172
+ cxxopts::value<std::string>()->implicit_value("implicit")
173
+ ```
174
+
175
+ If an option had both, then not specifying it would give the value `"value"`,
176
+ writing it on the command line as `--option` would give the value `"implicit"`,
177
+ and writing `--option=another` would give it the value `"another"`.
178
+
179
+ Note that the default and implicit value is always stored as a string,
180
+ regardless of the type that you want to store it in. It will be parsed as
181
+ though it was given on the command line.
182
+
183
+ Default values are not counted by `Options::count`.
184
+
185
+ ## Boolean values
186
+
187
+ Boolean options have a default implicit value of `"true"`, which can be
188
+ overridden. The effect is that writing `-o` by itself will set option `o` to
189
+ `true`. However, they can also be written with various strings using `=value`.
190
+ There is no way to disambiguate positional arguments from the value following
191
+ a boolean, so we have chosen that they will be positional arguments, and
192
+ therefore, `-o false` does not work.
193
+
194
+ ## `std::vector<T>` values
195
+
196
+ Parsing a list of values into a `std::vector<T>` is also supported, as long as `T`
197
+ can be parsed. To separate single values in a list the define symbol `CXXOPTS_VECTOR_DELIMITER`
198
+ is used, which is ',' by default. Ensure that you use no whitespaces between values
199
+ (unless the entire list is double quoted) because those would be interpreted as the
200
+ next command line option. Example for a command line option
201
+ that can be parsed as a `std::vector<double>`:
202
+
203
+ ~~~
204
+ --my_list=1,-2.1,3,4.5
205
+ ~~~
206
+
207
+ If the list of values is quoted, then spaces can be included. For example:
208
+
209
+ ~~~
210
+ --my_list="review,memory sanitize,build help,reformat"
211
+ ~~~
212
+
213
+ This will be parsed into `review`, `memory sanitize`, `build help`, and `reformat`.
214
+
215
+ ## Options specified multiple times
216
+
217
+ The same option can be specified several times, with different arguments, which will all
218
+ be recorded in order of appearance. An example:
219
+
220
+ ~~~
221
+ --use train --use bus --use ferry
222
+ ~~~
223
+
224
+ this is supported through the use of a vector of value for the option:
225
+
226
+ ~~~
227
+ options.add_options()
228
+ ("use", "Usable means of transport", cxxopts::value<std::vector<std::string>>())
229
+ ~~~
230
+
231
+ ## Custom help
232
+
233
+ The string after the program name on the first line of the help can be
234
+ completely replaced by calling `options.custom_help`. Note that you might
235
+ also want to override the positional help by calling `options.positional_help`.
236
+
237
+
238
+ ## Example
239
+
240
+ Putting all together:
241
+ ```cpp
242
+ #include <iostream>
243
+ #include "cxxopts.hpp"
244
+
245
+ int main(int argc, char** argv)
246
+ {
247
+ cxxopts::Options options("test", "A brief description");
248
+
249
+ options.add_options()
250
+ ("b,bar", "Param bar", cxxopts::value<std::string>())
251
+ ("d,debug", "Enable debugging", cxxopts::value<bool>()->default_value("false"))
252
+ ("f,foo", "Param foo", cxxopts::value<int>()->default_value("10"))
253
+ ("h,help", "Print usage")
254
+ ;
255
+
256
+ auto result = options.parse(argc, argv);
257
+
258
+ if (result.count("help"))
259
+ {
260
+ std::cout << options.help() << std::endl;
261
+ exit(0);
262
+ }
263
+ bool debug = result["debug"].as<bool>();
264
+ std::string bar;
265
+ if (result.count("bar"))
266
+ bar = result["bar"].as<std::string>();
267
+ int foo = result["foo"].as<int>();
268
+
269
+ return 0;
270
+ }
271
+ ```
272
+
273
+ # Linking
274
+
275
+ This is a header only library.
276
+
277
+ # Requirements
278
+
279
+ The only build requirement is a C++ compiler that supports C++11 features such as:
280
+
281
+ * regex
282
+ * constexpr
283
+ * default constructors
284
+
285
+ GCC >= 4.9 or clang >= 3.1 with libc++ are known to work.
286
+
287
+ The following compilers are known not to work:
288
+
289
+ * MSVC 2013
@@ -0,0 +1,16 @@
1
+ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2
+
3
+ http_archive(
4
+ name = "rules_fuzzing",
5
+ sha256 = "d9002dd3cd6437017f08593124fdd1b13b3473c7b929ceb0e60d317cb9346118",
6
+ strip_prefix = "rules_fuzzing-0.3.2",
7
+ urls = ["https://github.com/bazelbuild/rules_fuzzing/archive/v0.3.2.zip"],
8
+ )
9
+
10
+ load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
11
+
12
+ rules_fuzzing_dependencies()
13
+
14
+ load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init")
15
+
16
+ rules_fuzzing_init()