Skip to content

Commit

Permalink
fix: cli no input file behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
MrinmoyHaloi committed Mar 18, 2024
1 parent 66df83c commit a29f567
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 0 additions & 5 deletions Swirl/src/cli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ std::optional<std::string> cli::get_file() {
}

std::vector<Argument> cli::parse() {
if (m_argc <= 1) {
std::cout << USAGE << generate_help() << '\n';
exit(0);
}

std::vector<std::string_view> args(m_argv, m_argv + m_argc);
std::vector<Argument> supplied;

Expand Down
6 changes: 5 additions & 1 deletion Swirl/src/swirl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ int main(int argc, const char** const argv) {
else cxx = "g++";

std::optional<std::string> _file = app.get_file();
if (!_file.has_value()) { std::cerr << "No Input file\n"; return 1; }

if (!_file.has_value()) {
std::cerr << "No Input file\n"; return 1;
}

SW_FED_FILE_PATH = *app.get_file();

if (!std::filesystem::exists(SW_FED_FILE_PATH)) {
Expand Down

0 comments on commit a29f567

Please sign in to comment.