diff --git a/main.cpp b/main.cpp index dda1a2c..5f28ee2 100644 --- a/main.cpp +++ b/main.cpp @@ -203,16 +203,23 @@ extern "C" { #ifndef EMSCRIPTEN int main(int argc, char *argv[]) { - cxxopts::Options cmd_options("font-maker", "Create font PBFs."); + cxxopts::Options cmd_options("font-maker", "Create font PBFs from TTFs or OTFs."); cmd_options.add_options() - ("output", "Output directory", cxxopts::value()) - ("fonts", "Input fonts TTF or OTF", cxxopts::value>()) + ("output", "Output directory (to be created, must not already exist)", cxxopts::value()) + ("fonts", "Input font(s) (as TTF or OTF)", cxxopts::value>()) ("name", "Override output fontstack name", cxxopts::value()) + ("help", "Print usage") ; + cmd_options.positional_help(" [INPUT_FONT2 ...]"); cmd_options.parse_positional({"output","fonts"}); auto result = cmd_options.parse(argc, argv); + if (result.count("help")) + { + cout << cmd_options.help() << endl; + exit(0); + } if (result.count("output") == 0 || result.count("fonts") == 0) { - cout << "usage: font-maker OUTPUT_DIR INPUT_FONT [INPUT_FONT2 ...]" << endl; + cout << cmd_options.help() << endl; exit(1); } auto output_dir = result["output"].as();