summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5d7aa9)
raw | patch | inline | side by side (parent: c5d7aa9)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 15 Sep 2008 21:34:13 +0000 (21:34 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 15 Sep 2008 21:34:13 +0000 (21:34 +0000) |
src/main.cpp | patch | blob | history |
diff --git a/src/main.cpp b/src/main.cpp
index ba9ffde6a1baa3fce5caff539290c123fa0e4911..aac33b155294aab4c108f9d8812bb05ac216afca 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
sp_export_ps = NULL;
sp_export_eps = NULL;
sp_export_pdf = NULL;
- #ifdef WIN32
+#ifdef WIN32
sp_export_emf = NULL;
- #endif //WIN32
+#endif //WIN32
sp_export_text_to_path = FALSE;
sp_export_font = FALSE;
sp_export_bbox_page = FALSE;
doc = Inkscape::Extension::open(Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), filename);
}
if (doc == NULL) {
- g_warning("Specified document %s cannot be opened (is it valid SVG file?)", filename);
+ g_warning("Specified document %s cannot be opened (is it a valid SVG file?)", filename);
} else {
if (sp_vacuum_defs) {
vacuum_document(doc);
}
if ( strcmp(useme, "quit") == 0 ) {
// Time to quit
- fprintf(stdout, "done\n");
fflush(stdout);
- linedata = 0; // mark for exit
+ exit(0);
} else if ( len < 1 ) {
// blank string. Do nothing.
} else {
GError* parseError = 0;
gchar** argv = 0;
gint argc = 0;
- if ( g_shell_parse_argv(useme, &argc, &argv, &parseError) ) {
+ // add a dummy "inkscape" in front, as popt expects the program name there:
+ gchar *cl = g_strdup_printf ("inkscape %s", useme);
+ if ( g_shell_parse_argv(cl, &argc, &argv, &parseError) ) {
poptContext ctx = poptGetContext(NULL, argc, const_cast<const gchar**>(argv), options, 0);
poptSetOtherOptionHelp(ctx, _("[OPTIONS...] [FILE...]\n\nAvailable options:"));
if ( ctx ) {
resetCommandlineGlobals();
g_strfreev(argv);
} else {
- g_warning("problem parsing command-line");
+ g_warning("problem parsing commandline: %s", useme);
}
+ g_free(cl);
}
}
} // if (linedata...