00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "eggToSomething.h"
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 EggToSomething::
00030 EggToSomething(const string &format_name,
00031 const string &preferred_extension,
00032 bool allow_last_param, bool allow_stdout) :
00033 EggConverter(format_name, preferred_extension, allow_last_param,
00034 allow_stdout)
00035 {
00036 clear_runlines();
00037 if (_allow_last_param) {
00038 add_runline("[opts] input.egg output" + _preferred_extension);
00039 }
00040 add_runline("[opts] -o output" + _preferred_extension + " input.egg");
00041 if (_allow_stdout) {
00042 add_runline("[opts] input.egg >output" + _preferred_extension);
00043 }
00044
00045 string o_description;
00046
00047 if (_allow_stdout) {
00048 if (_allow_last_param) {
00049 o_description =
00050 "Specify the filename to which the resulting " + format_name +
00051 " file will be written. "
00052 "If this option is omitted, the last parameter name is taken to be the "
00053 "name of the output file, or standard output is used if there are no "
00054 "other parameters.";
00055 } else {
00056 o_description =
00057 "Specify the filename to which the resulting " + format_name +
00058 " file will be written. "
00059 "If this option is omitted, the " + format_name +
00060 " file is written to standard output.";
00061 }
00062 } else {
00063 if (_allow_last_param) {
00064 o_description =
00065 "Specify the filename to which the resulting " + format_name +
00066 " file will be written. "
00067 "If this option is omitted, the last parameter name is taken to be the "
00068 "name of the output file.";
00069 } else {
00070 o_description =
00071 "Specify the filename to which the resulting " + format_name +
00072 " file will be written.";
00073 }
00074 }
00075
00076 redescribe_option("o", o_description);
00077
00078 redescribe_option
00079 ("cs",
00080 "Specify the coordinate system of the resulting " + _format_name +
00081 " file. This may be "
00082 "one of 'y-up', 'z-up', 'y-up-left', or 'z-up-left'. The default "
00083 "is the same coordinate system as the input egg file. If this is "
00084 "different from the input egg file, a conversion will be performed.");
00085 }
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 bool EggToSomething::
00096 handle_args(ProgramBase::Args &args) {
00097 if (!check_last_arg(args, 1)) {
00098 return false;
00099 }
00100
00101 return EggConverter::handle_args(args);
00102 }