-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Tidy up command line arguments
- Loading branch information
1 parent
f19a27a
commit 5c90ac2
Showing
6 changed files
with
176 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// | ||
// Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
// Copyright (c) 2023 Vinnie Falco ([email protected]) | ||
// | ||
// Official repository: https://github.com/cppalliance/mrdox | ||
// | ||
|
||
#ifndef MRDOX_TOOL_TOOLARGS_HPP | ||
#define MRDOX_TOOL_TOOLARGS_HPP | ||
|
||
#include <llvm/Support/CommandLine.h> | ||
#include <string> | ||
|
||
namespace clang { | ||
namespace mrdox { | ||
|
||
enum Action : int | ||
{ | ||
test, | ||
update, | ||
generate | ||
}; | ||
|
||
/** Command line options and tool settings. | ||
*/ | ||
class ToolArgs | ||
{ | ||
ToolArgs(); | ||
|
||
llvm::cl::OptionCategory genCat; | ||
llvm::cl::OptionCategory testCat; | ||
|
||
public: | ||
static ToolArgs instance_; | ||
|
||
char const* usageText; | ||
llvm::cl::extrahelp extraHelp; | ||
|
||
// Common options | ||
llvm::cl::opt<Action> toolAction; | ||
llvm::cl::opt<std::string> configPath; | ||
llvm::cl::opt<std::string> outputPath; | ||
llvm::cl::list<std::string> inputPaths; | ||
|
||
// Generate options | ||
llvm::cl::opt<std::string> formatType; | ||
llvm::cl::opt<bool> ignoreMappingFailures; | ||
|
||
// Test options | ||
llvm::cl::opt<bool> badOption; | ||
|
||
// Hide all options which don't belong to us | ||
void hideForeignOptions(); | ||
}; | ||
|
||
/** Command line arguments passed to the tool. | ||
This is a global variable because of how the | ||
LLVM command line interface is designed. | ||
*/ | ||
constexpr ToolArgs& toolArgs = ToolArgs::instance_; | ||
|
||
} // mrdox | ||
} // clang | ||
|
||
#endif |
Oops, something went wrong.