File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424#include < string>
2525#include < vector>
2626
27+ #ifdef INCLUDE_FULL_LICENSE_INFO
28+ #include < license.h>
29+ #endif
30+
2731using std::cout;
2832using std::end;
2933using std::endl;
@@ -34,10 +38,6 @@ using std::vector;
3438
3539static const string PROGRAM_NAME = " dnmtools" ;
3640
37- static const std::string license_text = R"(
38-
39- )" ;
40-
4141struct dnmtools_command {
4242 string tag;
4343 string description;
@@ -148,6 +148,9 @@ print_help(
148148 const vector<pair<string, vector<dnmtools_command>>> &command_groups) {
149149 cout << " Program: " << PROGRAM_NAME << " \n "
150150 << " Version: " << VERSION << " \n "
151+ #ifdef INCLUDE_FULL_LICENSE_INFO
152+ << " License: use --license for full license info\n "
153+ #endif
151154 << " Usage: " << PROGRAM_NAME << " <command> [options]\n "
152155 << " Commands:" << endl;
153156 for (auto &&g : command_groups) {
@@ -224,12 +227,14 @@ main(int argc, char *argv[]) {
224227 return EXIT_SUCCESS;
225228 }
226229
230+ #ifdef INCLUDE_FULL_LICENSE_INFO
227231 for (auto i = 0 ; i < argc; ++i) {
228232 if (std::string (argv[i]) == " --license" ) {
229233 std::cout << license_text;
230234 return EXIT_SUCCESS;
231235 }
232236 }
237+ #endif
233238
234239 const auto has_tag = [&](const dnmtools_command &a) {
235240 return a.tag == argv[1 ];
You can’t perform that action at this time.
0 commit comments