All Classes Files Functions Variables Enumerations Enumerator Macros
outPut.cpp
Go to the documentation of this file.
1 #include "options.hpp"
11 
15 // Recreate the showlist, blacklist, and config files
16 void ConfigOpts::writeFout( string dirOut )
17 {
18  // Create a char array to hold the command that can be used by the system method
19  const char *charCmd;
20  // Create a temporary string to hold the command
21  string tmpCmd;
22 
23  // Create an object of type struct stat
24  struct stat readBuffer;
25  // Check if output directory exists
26  if( stat( dirOut.c_str(), &readBuffer ) != 0 )
27  {
28  // Create make directory command string
29  tmpCmd = MKDIR" \"" + dirOut + "\"";
30  // Convert to a char array
31  charCmd = tmpCmd.c_str();
32  // Check if compiling on Windows
33  #ifdef _WIN32
34  // Execute Windows system command
35  system( charCmd );
36  // Else compiling on Linux
37  #else
38  // Execute Linux system command
39  if ( system( charCmd ) == 0 ) {};
40  #endif
41  }
42 
43  // Writes the showlist file
44  writeShowList( dirOut );
45  // Writes the blacklist file
46  writeBlackList( dirOut );
47  // Writes the configuration file
48  writeConfigFile( dirOut );
49 };
50 
52 // Output the help information
54 {
55  cout << "Usage: clerk [OPTION] -i [INPUT] -o [OUTPUT]" << endl
56  << "Move, rename, and organize TV Show files from [INPUT] to [OUTPUT]." << endl
57  << endl
58  << "Available arguments:" << endl
59  << endl
60  << " -i [INPUT]\tRead from file or directory" << endl
61  << " -o [OUTPUT]\tWrite to directory" << endl
62  << " -B [BLIST]\tBlacklist location" << endl
63  << " -S [SLIST]\tShowlist location" << endl
64  << " -R\t\tRecurse directories" << endl
65  << " -e\t\tExecute the tasks internally" << endl
66  << " -t\t\tDisplay the tasks without performing them" << endl
67  << " -b [SCRIPT]\tWrite the tasks to a bash script" << endl
68  << " -r\t\tRename the files" << endl
69  << " -m\t\tMove the files" << endl
70  << " -c\t\tCopy the files" << endl
71  << " -D\t\tSeason folders use double digits" << endl
72  << " -q\t\tOutput no information" << endl
73  << " -s\t\tOutput summary information" << endl
74  << " -v\t\tOutput summary and error information" << endl
75  << " -l [LOG]\tWrite to log file" << endl
76  << " -x [XML]\tWrite to xml file" << endl
77  << " -g [GAP]\tWrite to gap file" << endl
78  << " -h\t\tDisplay this help and exit" << endl
79  << " -V\t\tOutput version information and exit" << endl
80  << " -F [DEST]\tRewrite showlist, blacklist, and config files to DEST" << endl
81  << endl
82 //RULER << "****************************************************************************"
83  << "[INPUT] can be either a directory or a file containing a list of shows." << endl
84  << "By default, files in [INPUT] are sorted into directories based on" << endl
85  << "show name and season as detected by the clerk." << endl
86  << endl
87  << "Accepted season and episode patterns:" << endl
88  << " S##E## (default output format)" << endl
89  << " S## E##" << endl
90  << " S# E##" << endl
91  << " S#E##" << endl
92  << " ##X##" << endl
93  << " #X##" << endl
94  << " ####" << endl
95  << " ###" << endl
96  << endl
97  << " -## (detected as multi-episode information)" << endl
98  << " A/B (detected as partial-episode information)" << endl
99  << endl
100  << "Example Output:" << endl
101  << " Showname S01E01 Title.avi" << endl
102  << " Showname S01E01-02 Title.avi" << endl
103  << " Showname S01E01B Title.avi" << endl
104  << endl
105  << "Report clerk bugs to erythros@gmail.com or emrysm@gmail.com" << endl;
106 };
107 
109 // Output the version information
111 {
112  cout << "clerk 0.37.154" << endl
113  << "Copyright (C) 2010 Free Software Foundation, Inc." << endl
114  << "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>." << endl
115  << "This is free software: you are free to change and redistribute it." << endl
116  << "There is NO WARRANTY, to the extent permitted by law." << endl
117  << endl
118  << "Written by Emrys Maier and Erick Tyndall." << endl;
119 };
static void printVersion()
Outputs the version information to the console.
Definition: outPut.cpp:110
static void writeFout(string)
Recreates the showlist, blacklist, and configuration files.
Definition: outPut.cpp:16
static void writeConfigFile(string)
Generates a default configuration file in the given directory.
Definition: writeConf.cpp:12
#define MKDIR
Definition: options.hpp:26
static void writeShowList(string)
Generates a default showlist file in a given directory.
Definition: writeShow.cpp:12
static void writeBlackList(string)
Generates a default blacklist file in the given directory.
Definition: writeBlack.cpp:12
The ConfigOpts class stores all config options, settings, and flags for clerk.
static void printHelp()
Outputs the help information to the console.
Definition: outPut.cpp:53