summaryrefslogtreecommitdiff
path: root/src/dyetool/dyemain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dyetool/dyemain.cpp')
-rw-r--r--src/dyetool/dyemain.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/dyetool/dyemain.cpp b/src/dyetool/dyemain.cpp
index 3199a5c49..fe7ad0588 100644
--- a/src/dyetool/dyemain.cpp
+++ b/src/dyetool/dyemain.cpp
@@ -46,13 +46,14 @@ int serverVersion = 0;
static void printHelp()
{
- std::cout << _("dyecmd srcfile dyestring dstfile")
- << std::endl << std::endl;
+ std::cout << _("dyecmd srcfile dyestring dstfile") << std::endl;
+ std::cout << _("or") << std::endl;
+ std::cout << _("dyecmd srcdyestring dstfile") << std::endl;
}
int main(int argc, char **argv)
{
- if (argc != 4)
+ if (argc < 3 || argc > 4)
printHelp();
logger = new Logger;
@@ -73,13 +74,24 @@ int main(int argc, char **argv)
resman->setWriteDir(".");
resman->addToSearchPath(".", false);
resman->addToSearchPath("/", false);
- Image *image = resman->getImage(std::string(
- argv[1]).append("|").append(argv[2]));
+ std::string src = argv[1];
+ std::string dst;
+ if (argc == 4)
+ {
+ src.append("|").append(argv[2]);
+ dst = argv[3];
+ }
+ else
+ {
+ dst = argv[2];
+ }
+
+ Image *image = resman->getImage(src);
if (!image)
{
printf("Error loading image\n");
return 1;
}
- ImageWriter::writePNG(image->getSDLSurface(), argv[3]);
+ ImageWriter::writePNG(image->getSDLSurface(), dst);
return 0;
}