#include #include #include #include void print_help(std::filesystem::path application_path) { std::println("Usage: {}", application_path.stem().string()); } int main(int argc, char* argv[]) { core::command_line_args_view command_line_args_view{argc, argv}; char help_option_name[]{"--help"}; char* fallback_argv[]{argv[0], help_option_name}; if (std::ranges::empty(command_line_args_view)) command_line_args_view = core::command_line_args_view(2, fallback_argv); for (auto&& arg : command_line_args_view) { arg.with("--help", [&] { print_help(command_line_args_view.appliation_path()); }); arg.with("--file=", [](std::filesystem::path file_path) { const std::string file_content = core::file_stream::file_content_as_string(file_path); std::println("{}", file_content); }); } return 0; }