return FALSE;
}
+void show_help(void)
+{
+ printf("pmount-gui\n"
+ "Copyright (c) 2011-2015 Mikko Rasa, Mikkosoft Productions\n\n"
+ "Usage: pmount-gui [-v] [-u] [-r <command>] [-h]\n\n"
+ "Options:\n"
+ " -v Increase verbosity\n"
+ " -u Unmount a device (default is mount)\n"
+ " -r Run a command after mounting\n"
+ " -h Display this help\n");
+}
+
int main(int argc, char **argv)
{
GtkWidget *window;
gtk_init(&argc, &argv);
- while((opt = getopt(argc, argv, "vur:"))!=-1) switch(opt)
+ while((opt = getopt(argc, argv, "vur:h"))!=-1) switch(opt)
{
case 'v':
++verbosity;
case 'r':
post_mount_command = optarg;
break;
+ case 'h':
+ show_help();
+ return 0;
}
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);