From 56fc32e977409e38b09bf4820244b3699f1e3b4c Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Sat, 23 Feb 2013 02:54:51 +0000 Subject: . git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83100 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfnet/gui.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'plugins/dfnet') diff --git a/plugins/dfnet/gui.c b/plugins/dfnet/gui.c index 7dbb5642..27644e99 100755 --- a/plugins/dfnet/gui.c +++ b/plugins/dfnet/gui.c @@ -214,18 +214,31 @@ int main(int argc, char *argv[]) { gtk_init(&argc, &argv); - if (!strcmp(argv[1], "configure")) { - CFGconfigure(); - } else if (!strcmp(argv[1], "open")) { - return CFGopen(); - } else if (!strcmp(argv[1], "wait")) { - CFGwait(); - } else if (!strcmp(argv[1], "pause")) { - return CFGpause(); - } else if (!strcmp(argv[1], "about")) { - CFGabout(); - } else if (!strcmp(argv[1], "message")) { - CFGmessage(&argv[2], argc - 2); + if (argc < 2) { + printf ("Usage: cfgDFNet {about | configure | open | wait | pause | message}\n"); + return 0; + } + + if (strcmp(argv[1], "configure") != 0 && + strcmp(argv[1], "about") != 0) { + printf ("Usage: cfgDFNet {about | configure | open | wait | pause | message}\n"); + return 0; + } + + if(argc > 1) { + if (!strcmp(argv[1], "configure")) { + CFGconfigure(); + } else if (!strcmp(argv[1], "about")) { + CFGabout(); + } else if (!strcmp(argv[1], "open")) { + return CFGopen(); + } else if (!strcmp(argv[1], "wait")) { + CFGwait(); + } else if (!strcmp(argv[1], "pause")) { + return CFGpause(); + } else if (!strcmp(argv[1], "message")) { + CFGmessage(&argv[2], argc - 2); + } } return 0; -- cgit v1.2.3