Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite1145f3

Browse files
committed
Update args
1 parente13f418 commite1145f3

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

‎buildcc/lib/args/include/args/args.h‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,6 @@ class Args {
152152
static Instance &Init();
153153
staticvoidDeinit();
154154

155-
/**
156-
* @brief Modifiable reference to CLI::App (CLI11)
157-
*/
158-
static CLI::App &Ref();
159-
160-
/**
161-
* @brief Constant reference to CLI::App (CLI11)
162-
*/
163-
// static const CLI::App &ConstRef();
164-
165155
// Getters
166156
staticboolClean();
167157
static env::LogLevelGetLogLevel();
@@ -171,7 +161,7 @@ class Args {
171161

172162
private:
173163
staticvoidRootArgs();
174-
static CLI::App &MyRef();
164+
static CLI::App &Ref();
175165

176166
private:
177167
static std::unique_ptr<Internal> internal_;

‎buildcc/lib/args/src/args.cpp‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ Args::Instance &Args::Init() {
109109

110110
voidArgs::Deinit() { internal_.reset(nullptr); }
111111

112-
CLI::App &Args::Ref() {return internal_->app; }
113-
// const CLI::App &Args::ConstRef() { return internal_->app; }
114-
115112
boolArgs::Clean() {return clean_; }
116113
env::LogLevelArgs::GetLogLevel() {return loglevel_; }
117114

@@ -121,14 +118,13 @@ const fs::path &Args::GetProjectBuildDir() { return project_build_dir_; }
121118
// Private
122119

123120
voidArgs::RootArgs() {
124-
Ref().set_help_all_flag(kHelpAllParam,kHelpAllDesc);
121+
auto &app =Ref();
122+
app.set_help_all_flag(kHelpAllParam,kHelpAllDesc);
125123

126-
Ref()
127-
.set_config(kConfigParam,"",kConfigDesc)
128-
->expected(kMinFiles,kMaxFiles);
124+
app.set_config(kConfigParam,"",kConfigDesc)->expected(kMinFiles,kMaxFiles);
129125

130126
// Root flags
131-
auto *root_group =Ref().add_option_group(kRootGroup);
127+
auto *root_group =app.add_option_group(kRootGroup);
132128

133129
root_group->add_flag(kCleanParam, clean_,kCleanDesc);
134130
root_group->add_option(kLoglevelParam, loglevel_,kLoglevelDesc)
@@ -141,7 +137,7 @@ void Args::RootArgs() {
141137
->required();
142138
}
143139

144-
CLI::App &Args::MyRef() {return internal_->app; }
140+
CLI::App &Args::Ref() {return internal_->app; }
145141

146142
// Args::Instance
147143

@@ -204,13 +200,13 @@ Args::Instance &Args::Instance::AddTarget(const std::string &name,
204200

205201
Args::Instance &Args::Instance::AddCustomCallback(
206202
const std::function<void(CLI::App &)> &add_cb) {
207-
auto &app =MyRef();
203+
auto &app =Ref();
208204
add_cb(app);
209205
return *this;
210206
}
211207

212208
Args::Instance &Args::Instance::AddCustomData(ArgCustom &data) {
213-
auto &app =MyRef();
209+
auto &app =Ref();
214210
data.Add(app);
215211
return *this;
216212
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp