Changeset 88


Ignore:
Timestamp:
Apr 4, 2006, 1:06:13 PM (15 years ago)
Author:
Jari Häkkinen
Message:

Added --version option.

Location:
trunk/se/lu/thep/wenni/bin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/se/lu/thep/wenni/bin/NNIFileConverter/Parameter.cc

    r73 r88  
    22
    33#include "Parameter.h"
     4#include <config.h> // this header file is created by configure
    45
    56#include <cstdlib>
     
    7273          ok=true;
    7374        }
     75      if (myargv=="--version") {
     76          version();
     77          exit(0);
     78      }
    7479      if (myargv==string("-weight"))
    7580        if ((i+1)<argc) {
     
    221226              << "\t-logratio output file logratio (first/second)\n"
    222227              << "\t          [" << logratio_ << "\n"
     228              << "\t--version print version information and exit\n"
    223229              << "\t-weight   output file weight\n"
    224230              << "\t          [" << weight_ << "]\n";
    225231  }
    226232
     233
     234  void Parameter::version(void) const
     235  {
     236    using namespace std;
     237    cout << PACKAGE_STRING
     238         << "\nCopyright (C) 2006 Jari Häkkinen and Peter Johansson.\n\n"
     239         << "This is free software; see the source for copying conditions.\n"
     240         << "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR\n"
     241         << "A PARTICULAR PURPOSE." << endl;
     242  }
     243
    227244}}} // of namespace nnifileconverter, wenni and namespace theplu
  • trunk/se/lu/thep/wenni/bin/NNIFileConverter/Parameter.h

    r69 r88  
    3131    void defaults(void);
    3232    void help(void) const;
     33    void version(void) const;
    3334
    3435    double beta_;
  • trunk/se/lu/thep/wenni/bin/nni/Parameter.cc

    r69 r88  
    33#include "Parameter.h"
    44#include "nni.h"
     5#include <config.h> // this header file is created by configure
    56
    67#include <iostream>
     
    5455              ok=false;
    5556        }
     57      if (myargv=="--version") {
     58          version();
     59          exit(0);
     60      }
    5661      if (myargv==string("-weight"))
    5762        if (++i<argc) {
     
    121126  }
    122127
     128
     129
     130  void Parameter::version(void) const
     131  {
     132    using namespace std;
     133    cout << PACKAGE_STRING
     134         << "\nCopyright (C) 2005-2006 Jari Häkkinen and Peter Johansson.\n\n"
     135         << "This is free software; see the source for copying conditions.\n"
     136         << "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR\n"
     137         << "A PARTICULAR PURPOSE." << endl;
     138  }
     139
    123140}} // of namespace wenni and namespace theplu
  • trunk/se/lu/thep/wenni/bin/nni/Parameter.h

    r69 r88  
    2929    void analyse(void);
    3030    void defaults(void);
     31    void version(void) const;
    3132
    3233    double beta_;
  • trunk/se/lu/thep/wenni/bin/nni/nni.hlp

    r74 r88  
    2121std::cout << "       Available algorithms are kNNI and WeNNI and a string\n";
    2222std::cout << "       is expected as the option\n";
     23std::cout << "  --version print version information and exit\n";
    2324std::cout << "  -weight: set the weight (or SNR) file name (weight.data)\n";
    2425std::cout << "       Weights must be within [0,1].\n";
Note: See TracChangeset for help on using the changeset viewer.