+simple 'Syntax' help
[captive.git] / src / client / cmdline / main.c
1 /* FIXME: test source only! Don't pass into CVS! */
2
3 #include "config.h"
4
5 #include <glib/gmessages.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <glib/giochannel.h>
9
10 #include <captive/client.h>     /* for captive_init() */
11
12
13 void captive_sandbox_init(void);
14
15 int main(int argc,char **argv)
16 {
17         if (argc>3) {
18                 fprintf(stderr,"Syntax: captivecmdline <captive_args> <image_filename>");
19                 exit(EXIT_FAILURE);
20                 }
21
22         if (!captive_init(argv[1],
23                         (!argv[2] ? NULL : g_io_channel_new_file(       /* FIXME: g_io_channel_new_file() is NOT 64-bit compliant! */
24                                         argv[2],        /* filename */
25                                         "r",    /* mode */
26                                         NULL))))        /* error */
27                 g_error(_("captive_init FAIL"));
28
29         return EXIT_SUCCESS;
30 }