Read file passed through argv[]
This commit is contained in:
@ -8,7 +8,8 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
include_directories(include)
|
||||
|
||||
add_executable(bfuck
|
||||
src/main.cpp
|
||||
src/main.cpp
|
||||
src/lex.cpp
|
||||
)
|
||||
|
||||
# target_link_libraries(lasm Boost::program_options)
|
||||
|
14
src/main.cpp
14
src/main.cpp
@ -1,5 +1,15 @@
|
||||
#include "lex.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, World!" << std::endl;
|
||||
int main(int argc, char **argv) {
|
||||
if (argc != 2) {
|
||||
std::cout << "Usage: bfuck <IN-PATH>" << std::endl;
|
||||
}
|
||||
std::cout << "Running " << argv[1] << "...\n" << std::endl;
|
||||
|
||||
std::string tokens;
|
||||
lex_brainfuck_file(argv[1], tokens);
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user