3939#include " filemanager.hpp"
4040#include " proj.h"
4141#include " proj_internal.h"
42+ #include " emess.h"
4243
4344#include " proj/internal/include_nlohmann_json.hpp"
4445#include " proj/internal/internal.hpp"
@@ -76,6 +77,9 @@ class ParsingException : public std::exception {
7677 std::cerr << " [--quiet | --verbose] [--dry-run] [--list-files]"
7778 << std::endl;
7879 std::cerr << " [--no-version-filtering]" << std::endl;
80+ std::cerr << " [--version]" << std::endl;
81+ std::cerr << " [--release]" << std::endl;
82+ std::cerr << " [--short-version]" << std::endl;
7983 std::exit (1 );
8084}
8185
@@ -116,6 +120,11 @@ int main(int argc, char *argv[]) {
116120
117121 auto ctx = pj_get_default_ctx ();
118122
123+ if ((emess_dat.Prog_name = strrchr (*argv, ' /' )) != nullptr )
124+ ++emess_dat.Prog_name ;
125+ else
126+ emess_dat.Prog_name = *argv;
127+
119128 std::string targetDir;
120129 std::string endpoint (proj_context_get_url_endpoint (ctx));
121130 const std::string geojsonFile (" files.geojson" );
@@ -139,7 +148,12 @@ int main(int argc, char *argv[]) {
139148
140149 for (int i = 1 ; i < argc; i++) {
141150 std::string arg (argv[i]);
142- if (arg == " --endpoint" && i + 1 < argc) {
151+ if (arg == " --version" )
152+ {
153+ std::cout << emess_dat.Prog_name << " : " << pj_get_version () << std::endl;
154+ std::exit (0 );
155+ }
156+ else if (arg == " --endpoint" && i + 1 < argc) {
143157 i++;
144158 endpoint = argv[i];
145159 } else if (arg == " --user-writable-directory" ) {
0 commit comments