34 "Display this help screen.",
35 "Typing `frobby help' displays a list of the available actions.\n"
36 "Typing `frobby help ACTION' displays a detailed description of that "
38 "As an example, typing `frobby help irrdecom' will yield detailed "
40 "about the irrdecom action.",
62 out <<
"Displaying information on action: " << action.
getName() <<
"\n\n";
65 vector<Parameter*> parameters;
67 sort(parameters.begin(), parameters.end(), paramCmp);
71 if (!parameters.empty()) {
72 fprintf(stderr,
"\nThe parameters accepted by %s are as follows.\n",
75 typedef vector<Parameter*>::const_iterator cit;
76 for (cit it = parameters.begin(); it != parameters.end(); ++it) {
77 string defaultValue = (*it)->getValueAsString();
78 fprintf(stderr,
"\n -%s %s (default is %s)\n",
79 (*it)->getName().c_str(),
80 (*it)->getArgumentType().c_str(),
81 (*it)->getValueAsString().c_str());
82 display((*it)->getDescription(),
" ");
89 (
"Displaying information on topic: io\n"
91 "Frobby understands several file formats. These are not documented, "
92 "but they are simple enough that seeing an example should be enough "
93 "to figure them out. Getting an example is as simple as making "
94 "Frobby produce output in that format. "
96 "It is true of all the formats that white-space is insignificant, "
97 "but other than that Frobby is quite fuzzy about how the input "
98 "must look. E.g. a Macaulay 2 file containing a monomial ideal "
99 "must start with \"R = \", so writing \"r = \" with a lower-case r "
100 "is an error. To help with this, Frobby tries to say what is wrong "
101 "if there is an error."
103 "If no input format is specified, Frobby will guess at the format, "
104 "and it will guess correctly if there are no errors in the input. "
105 "If no output format is specified, Frobby will use the same format "
106 "for output as for input. If you want to force Frobby to use a "
107 "specific format, use the -iformat and -oformat options. Using "
108 "these with the transform action allows translation between formats. "
110 "The formats available in Frobby and the types of data they "
111 "support are as follows. "
114 vector<string> names;
116 for (vector<string>::const_iterator name = names.begin();
117 name != names.end(); ++name) {
119 ASSERT(handler.get() != 0);
121 fprintf(stderr,
"\n* The format %s: %s\n",
123 handler->getDescription());
127 for (vector<const DataType*>::const_iterator typeIt = types.begin();
128 typeIt != types.end(); ++typeIt) {
131 bool input = handler->supportsInput(type);
132 bool output = handler->supportsOutput(type);
134 const char* formatStr =
"";
136 formatStr =
" - supports input and output of %s.\n";
138 formatStr =
" - supports input of %s.\n";
140 formatStr =
" - supports output of %s.\n";
142 fprintf(stderr, formatStr, type.
getName());
160 <<
" Copyright (C) 2007 Bjarke Hammersholt Roune\n";
162 "Frobby performs a number of computations related to monomial "
163 "ideals.\nYou run it by typing `frobby ACTION', where ACTION is "
164 "one of the following. "
171 vector<string> names;
173 for (vector<string>::const_iterator it = names.begin();
174 it != names.end(); ++it) {
176 if (action->displayAction()) {
177 printer[0] << action->getName() <<
'\n';
178 printer[1] << action->getShortDescription() <<
'\n';
184 "\nType 'frobby help ACTION' to get more details on a specific action.\n"
185 "Note that all input and output is done via the standard streams.\n"
186 "Type 'frobby help io' for more information on input and output formats.\n"
187 "See www.broune.com for further information and new versions of Frobby.\n"
189 "Frobby is free software and you are welcome to redistribute it under certain "
190 "conditions. Frobby comes with ABSOLUTELY NO WARRANTY. See the GNU General "
191 "Public License version 2.0 in the file COPYING for details.\n";
void getIOHandlerNames(vector< string > &names)
Add the name of each fomat to names.
auto_ptr< IOHandler > createIOHandler(const string &prefix)
Returns an IOHandler for the format whose name has the given prefix.
const char * getName() const
static auto_ptr< Action > createActionWithPrefix(const string &prefix)
const char * getDescription() const
virtual void obtainParameters(vector< Parameter * > ¶meters)
static void getActionNames(vector< string > &names)
void print(ostream &out) const
void addColumn(bool flushLeft=true, const string &prefix=" ", const string &suffix="")
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
const char * getName() const
Returns the name of the structure.
static vector< const DataType * > getTypes()
Returns a vector of all types except null.
A replacement for stringstream.
virtual void processNonParameter(const char *str)
virtual bool displayAction() const
Returns whether this action should be shown to the user by the help action.
static const char * staticGetName()
virtual void obtainParameters(vector< Parameter * > ¶meters)
void displayActionHelp(Action &action)
const string & getName() const
void display(const string &msg, const string &prepend)
Display msg to standard error with automatic line breaking.
This file contains functions for printing strings to standard error.
const char *const version