diff --git a/ctlrender/main.cc b/ctlrender/main.cc index f89e987..91aefca 100644 --- a/ctlrender/main.cc +++ b/ctlrender/main.cc @@ -468,11 +468,8 @@ int main(int argc, const char **argv) if (input_image_files.size() < 2) { - fprintf(stderr, - "one or more source filenames and a destination " - "file or directory must be\nprovided. if more than one " - "source filenames is provided then the last argument\nmust " - "be a directory. see -help for more details.\n"); + usage(NULL); + exit(1); } @@ -509,9 +506,9 @@ int main(int argc, const char **argv) if (!force_overwrite_output_file) { fprintf(stderr, - "The destination file %s already exists.\n" - "Cravenly refusing to overwrite unless you supply " - "the -force option.\n", outputFile); + "The destination file %s already exists. Refusing to overwrite the existing file.\n" + "To overwrite the existing file use the -force option.\n" + , outputFile); exit(1); } else @@ -588,8 +585,8 @@ int main(int argc, const char **argv) "You have specified a destination file " "type with the -format option, but the\noutput " "file extension does not match the format " - "specified by the -format option.\nCravenly " - "refusing to do this unless you specify the " + "specified by the -format option.\nThis behavior " + "can be overridden by specifing the " "-force option (which\nwill make the -format " "option take priority).\n"); exit(1); @@ -671,7 +668,7 @@ int main(int argc, const char **argv) } if (access(outputFile, F_OK) >= 0) { - fprintf(stderr, "Cravenly refusing to overwrite the file '%s'.\n", outputFile); + fprintf(stderr, "Can not overwrite the file '%s'.\n", outputFile); exit(1); } actual_format.squish = noalpha; @@ -683,7 +680,7 @@ int main(int argc, const char **argv) } catch (std::exception &e) { - fprintf(stderr, "exception thrown (oops...): %s\n", e.what()); + fprintf(stderr, "\nexception thrown (oops...): %s\n", e.what()); return 1; } } diff --git a/ctlrender/transform.cc b/ctlrender/transform.cc index dd14b00..3912531 100644 --- a/ctlrender/transform.cc +++ b/ctlrender/transform.cc @@ -184,7 +184,7 @@ void set_ctl_function_argument_from_ctl_results(Ctl::FunctionArgPtr *arg, const } else { - THROW(Iex::ArgExc, "CTL parameter '" << dst->name() << "' not specified on the command line and does not have a default value."); + THROW(Iex::ArgExc, "A value for the CTL input variable '" << dst->name() << "' does not exist, was not specified on the command line,\nand does not have a default value. A value can be provided at runtime using command line parameters. See '-help param'\n"); throw(std::exception()); } return; diff --git a/ctlrender/usage.cc b/ctlrender/usage.cc index 0de7eac..c23be68 100644 --- a/ctlrender/usage.cc +++ b/ctlrender/usage.cc @@ -58,7 +58,7 @@ void usage(const char *section) { if(section==NULL) { - fprintf(stdout, "" + fprintf(stdout, "\n" "ctlrender - transforms an image using one or more CTL scripts, potentially\n" " converting the file format in the process\n" "\nusage:\n" @@ -110,9 +110,18 @@ void usage(const char *section) { "\n" " -verbose Increases the level of output verbosity.\n" " -quiet Decreases the level of output verbosity.\n" -""); +"\n" +" -force Overrides the default program behavior in some\n" +" instances such as overwriting existing files and\n" +" requiring format specified and file extensions\n" +" match.\n" +"\n" +" -help Prints this message. Additional help details are\n" +" available for some options by specifying an option\n" +" after '-help' (e.g. '-help format').\n" +"\n"); } else if(!strncmp(section, "format", 1)) { - fprintf(stdout, "" + fprintf(stdout, "\n" "format conversion:\n" "\n" " ctlrender provides file format conversion either implicitly by the\n" @@ -156,10 +165,10 @@ void usage(const char *section) { "\n" " Note that no automatic depth scaling is performed, please see\n" " '-help scale' for more details on how scaling is performed.\n" -""); +"\n"); } else if(!strncmp(section, "compression", 2)) { #if defined(HAVE_OPENEXR) - fprintf(stdout, "" + fprintf(stdout, "\n" "exr compression:\n" "\n" " ctlrender provides the option of a compression scheme when saving an \n" @@ -185,9 +194,9 @@ void usage(const char *section) { "\n" " B44A (lossy) Like B44 but smaller for images containing large\n" " uniform areas.\n" -""); +"\n"); #else - fprintf(stdout, "" + fprintf(stdout, "\n" "exr compression:\n" "\n" " ctlrender provides the option of a compression scheme when saving an \n" @@ -198,21 +207,21 @@ void usage(const char *section) { "\n" " OpenEXR support must be enabled for the '-compression' option to be\n" " meaningful. Please see build documentation for details.\n" -""); +"\n"); #endif } else if(!strncmp(section, "ctl", 1)) { - fprintf(stdout, "" + fprintf(stdout, "\n" "ctl file interpretation:\n" " ctlrender treats all ctl files as if they take their input as 'R', 'G',\n" " 'B', and 'A' (optional) channels, and produce output as 'R', 'G', and\n" " 'B', and 'A' (if required) channels. In the event of a single channel\n" " input file only the 'G' channel will be used.\n" -""); +"\n"); //" The *LAST* function in the file is the function that will be called to\n" //" provide the transform. This is to maintain compatability with scripts\n" //" developed for Autodesk's TOXIC product.\n" } else if(!strncmp(section, "scale", 1)) { - fprintf(stderr, "" + fprintf(stderr, "\n" "input and output value scaling:\n" "\n" " To deal with differences in input and output file bit depth, the ability\n" @@ -258,9 +267,9 @@ void usage(const char *section) { "\n" " In all cases the CTL output values (after output_scaling) are clipped\n" " to the maximum values supported by the output file format.\n" -""); +"\n"); } else if(!strncmp(section, "param", 1)) { - fprintf(stdout, "" + fprintf(stdout, "\n" "ctl parameters:\n" "\n" " In CTL scripts it is possible to define parameters that are not set\n" @@ -275,7 +284,7 @@ void usage(const char *section) { " -global_param1 \n" " -global_param2 \n" " -global_param3 \n" -""); +"\n"); } else { fprintf(stdout, "" "The '%s' section of the help does not exist. Try running ctlrender with\n"