Skip to content

Commit 8fa05ab

Browse files
committed
支持从命令行传入配置
1 parent acde1d3 commit 8fa05ab

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CodeFormat/src/CodeFormat.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int main(int argc, char** argv)
6767
}
6868
else
6969
{
70-
std::cerr << "not special input file"<<std::endl;
70+
std::cerr << "not special input file" << std::endl;
7171
return -1;
7272
}
7373

@@ -88,9 +88,14 @@ int main(int argc, char** argv)
8888
else
8989
{
9090
options = std::make_shared<LuaCodeStyleOptions>();
91+
if (!cmd.GetKeyValueOptions().empty())
92+
{
93+
LuaEditorConfig::ParseFromSection(options, cmd.GetKeyValueOptions());
94+
}
9195
}
9296

93-
if (!cmd.HasOption("outfile")) {
97+
if (!cmd.HasOption("outfile"))
98+
{
9499
options->end_of_line = "\n";
95100
}
96101

0 commit comments

Comments
 (0)