| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,6 +42,10 @@ int main(int argc, char** argv) | |||
| 42 | 42 | if (!cmd.Get<std::string>("file").empty()) | |
| 43 | 43 | { | |
| 44 | 44 | 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 | + } | ||
| 45 | 49 | } | |
| 46 | 50 | else if (cmd.Get<int>("stdin") != 0) | |
| 47 | 51 | { | |
@@ -56,11 +60,16 @@ int main(int argc, char** argv) | |||
| 56 | 60 | parser = LuaParser::LoadFromBuffer(std::move(buffer)); | |
| 57 | 61 | } | |
| 58 | 62 | ||
| 59 | - std::shared_ptr<LuaCodeStyleOptions> options; | ||
| 63 | + std::shared_ptr<LuaCodeStyleOptions> options = nullptr; | ||
| 64 | + | ||
| 60 | 65 | if (!cmd.Get<std::string>("config").empty()) | |
| 61 | 66 | { | |
| 62 | 67 | options = LuaCodeStyleOptions::ParseFromEditorConfig(cmd.Get<std::string>("config")); | |
| 63 | 68 | } | |
| 69 | + else | ||
| 70 | + { | ||
| 71 | + options = std::make_shared<LuaCodeStyleOptions>(); | ||
| 72 | + } | ||
| 64 | 73 | ||
| 65 | 74 | parser->BuildAstWithComment(); | |
| 66 | 75 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments