• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 The Tint Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef FUZZERS_CLI_H_
16 #define FUZZERS_CLI_H_
17 
18 #include <cstdint>
19 
20 namespace tint {
21 namespace fuzzers {
22 
23 /// CLI parameters accepted by the fuzzer. Type -tint_help in the CLI to see the
24 /// help message
25 struct CliParams {
26   bool dump_input = false;
27 };
28 
29 /// @brief Parses CLI parameters.
30 ///
31 /// This function will exit the process with non-zero return code if some
32 /// parameters are invalid. This function will remove recognized parameters from
33 /// `argv` and adjust `argc` accordingly.
34 ///
35 /// @param argc - the total number of parameters.
36 /// @param argv - array of all CLI parameters.
37 /// @return parsed parameters.
38 CliParams ParseCliParams(int* argc, char** argv);
39 
40 }  // namespace fuzzers
41 }  // namespace tint
42 
43 #endif  // FUZZERS_CLI_H_
44