+simple 'Syntax' help
authorshort <>
Sat, 11 Jan 2003 18:13:39 +0000 (18:13 +0000)
committershort <>
Sat, 11 Jan 2003 18:13:39 +0000 (18:13 +0000)
argv[2] is now optional
 - it is complained by captive_init() if not present

src/client/cmdline/main.c

index 1e18c29..b44f1e4 100644 (file)
 #include <captive/client.h>    /* for captive_init() */
 
 
+void captive_sandbox_init(void);
+
 int main(int argc,char **argv)
 {
+       if (argc>3) {
+               fprintf(stderr,"Syntax: captivecmdline <captive_args> <image_filename>");
+               exit(EXIT_FAILURE);
+               }
+
        if (!captive_init(argv[1],
-                       g_io_channel_new_file(  /* FIXME: g_io_channel_new_file() is NOT 64-bit compliant! */
+                       (!argv[2] ? NULL : g_io_channel_new_file(       /* FIXME: g_io_channel_new_file() is NOT 64-bit compliant! */
                                        argv[2],        /* filename */
                                        "r",    /* mode */
-                                       NULL))) /* error */
+                                       NULL))))        /* error */
                g_error(_("captive_init FAIL"));
 
        return EXIT_SUCCESS;