File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ int main(int argc, char** argv)
4242 if (!cmd.Get <std::string>(" file" ).empty ())
4343 {
4444 parser = LuaParser::LoadFromFile (cmd.Get <std::string>(" file" ));
45+ if (!parser)
46+ {
47+ std::cerr << format (" can not find file: {}" , cmd.Get <std::string>(" file" )) << std::endl;
48+ }
4549 }
4650 else if (cmd.Get <int >(" stdin" ) != 0 )
4751 {
@@ -56,11 +60,16 @@ int main(int argc, char** argv)
5660 parser = LuaParser::LoadFromBuffer (std::move (buffer));
5761 }
5862
59- std::shared_ptr<LuaCodeStyleOptions> options;
63+ std::shared_ptr<LuaCodeStyleOptions> options = nullptr ;
64+
6065 if (!cmd.Get <std::string>(" config" ).empty ())
6166 {
6267 options = LuaCodeStyleOptions::ParseFromEditorConfig (cmd.Get <std::string>(" config" ));
6368 }
69+ else
70+ {
71+ options = std::make_shared<LuaCodeStyleOptions>();
72+ }
6473
6574 parser->BuildAstWithComment ();
6675
You can’t perform that action at this time.
0 commit comments