00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <jsoc_main.h>
00019
00020 char *module_name = "CookbookRecipe:01";
00021
00022
00023 char *version_id = "1.0";
00024
00025 ModuleArgs_t module_args[] = {
00026
00027 {ARG_FLAG, "a", "", "force an abort"},
00028 {ARG_FLAG, "v", "", "run in verbose mode"},
00029 {ARG_STRING, "print", "done", "message to print on successful completion"},
00030
00031 {ARG_END}
00032 };
00033
00034 int DoIt (void) {
00035 int status;
00036
00037 char *msg = strdup (cmdparams_get_str (&cmdparams, "print", &status));
00038
00039 if (params_isflagset (&cmdparams, "v"))
00040 printf ("running module %s version %s\n", module_name, version_id);
00041 if (params_isflagset (&cmdparams, "a")) {
00042 printf ("aborting\n");
00043 return 1;
00044 }
00045
00046 printf ("%s\n", msg);
00047
00048 return 0;
00049 }
00050
00051
00052
00053
00054
00055