/** readparm.c **/ #include int toolbarParm = FALSE; char *titleParm = NULL; char *backgroundParm = NULL; int widthParm = 100; int heightParm = 50; struct poptOption opt[] = { { "title",'t', POPT_ARG_STRING, &titleParm,0, "The text to appear on the title bar", "TITLE" },{ "width",'w', POPT_ARG_INT, &widthParm,0, "The width of the window", "WIDTH" },{ "height",'h', POPT_ARG_INT, &heightParm,0, "The height of the window", "HEIGHT" },{ "toolbar",'T', POPT_ARG_NONE, &toolbarParm,0, "Dislay the toolbar", NULL },{ "background",'\0', POPT_ARG_STRING, &backgroundParm,0, "The background color for the window", "COLORNAME" },{ NULL,0,0,NULL,0,NULL,NULL }}; int main(int argc,char *argv[]) { poptContext context; gnome_init_with_popt_table("readparm","1.0",argc,argv, opt,0,&context); g_print("toolbar: %s\n", toolbarParm ? "TRUE" : "FALSE"); g_print("title: %s\n",titleParm ? titleParm : "NULL"); g_print("background: %s\n", backgroundParm ? backgroundParm : "NULL"); g_print("width: %d\n",widthParm); g_print("height: %d\n",heightParm); poptFreeContext(context); exit(0); }