Changeset 1411 for branches


Ignore:
Timestamp:
Aug 15, 2008, 7:57:17 PM (15 years ago)
Author:
Peter
Message:

modified the example code showing how to let --version option override possible errors such as missing mandatory options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4-stable/yat/utility/CommandLine.h

    r1396 r1411  
    6262     }
    6363     catch (cmd_error& e){
     64       if (version.present()){
     65         std::cout << cmd.program_name() << " 1.0\n"
     66                   << "Copyright (C) 2007 Peter Johansson\n\n"
     67                   << "This is free software see the source for copying "
     68                   << "conditions. There is NO\nwarranty; not even for "
     69                   << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
     70         exit(0);
     71       }
    6472       std::cout << e.what() << std::endl;
    6573       return 1;
    6674     } 
    67      if (version.present()){
    68        std::cout << cmd.program_name() << " 1.0\n"
    69                  << "Copyright (C) 2007 Peter Johansson\n\n"
    70                  << "This is free software see the source for copying "
    71                  << "conditions. There is NO\nwarranty; not even for "
    72                  << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
    73        exit(0);
    74      }
    7575     ...
    7676     \endcode
Note: See TracChangeset for help on using the changeset viewer.