/*************************************************************************** commandlineoptions.cpp - description ------------------- begin : Don Sep 19 2002 copyright : (C) 2002 by alex email : alex@rsh-318 ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include "commandlineoptions.h" #include #include "CTuxCardsConfiguration.h" #include "./information/xmlpersister.h" #include "./information/htmlwriter.h" #include "version.h" // ------------------------------------------------------------------------------- CommandLineOptions::CommandLineOptions(int argc, char** argv) // ------------------------------------------------------------------------------- { this->argc=argc; this->argv=argv; QString option = argv[1]; if (option=="-e"){ if (argc > 2 && QString(argv[2])=="html") { if (argc <= 4) htmlExport(argc==4 ? argv[3] : ""); else if (argc == 5) htmlExport(argv[3], argv[4]); else printUsage(); } else { printUsage(); } exit(0); }else if (option=="-v"){ std::cout<<"Tuxcards - The Notebook for Tuxfreaks"< # starts the application using \n" <<" tuxcards -e html # exports to html using the datafile found\n" <<" in .tuxcards\n" <<" tuxcards -e html # exports to html using the as input\n" <<" tuxcards -e html # exports to html using the as input\n" <<" and the specified as export directory\n" <<"\n" <<"Options:\n" <<" -e html HTML export; An optional file name and directory may be given.\n" <<" If no file is specified the file name is extracted from the\n" <<" configuration file '~/.tuxcards'. If no directory is given, the\n" <<" the html export will be done to the default export directory\n" <<" '~/tuxcardsHTML'.\n" <<" -v Print TuxCards version.\n" <<" -h Shows these usage information.\n" <<"\n" <<"For questions or bugs write to Alexander Theel ." <