Template
Add '--file=' argument
This commit is contained in:
1 parent
753b64c826
commit
c092cec25a
1 file changed
+6
@@ -1,3 +1,4 @@
|
|||||||
|
#include <core-library/io/file-stream.h>
|
||||||
#include <core-library/views/command-line-args-view.h>
|
#include <core-library/views/command-line-args-view.h>
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
@@ -23,6 +24,11 @@ int main(int argc, char* argv[])
|
|||||||
arg.with("--help", [&] {
|
arg.with("--help", [&] {
|
||||||
print_help(command_line_args_view.appliation_path());
|
print_help(command_line_args_view.appliation_path());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
arg.with("--file=", [](std::filesystem::path file_path) {
|
||||||
|
const std::string file_contents = core::file_stream::file_contents_as_string(file_path);
|
||||||
|
std::println("{}", file_contents);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user