mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-27 15:44:27 +02:00
Let's use getopt..
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@210 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
38d2f7576b
commit
56fd9165d0
@ -1478,28 +1478,35 @@ main (int argc, char** argv)
|
|||||||
/* for chroot and program execution */
|
/* for chroot and program execution */
|
||||||
char atrcfilename[81], *spool;
|
char atrcfilename[81], *spool;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
int i;
|
int c;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++)
|
while ((c = getopt(argc, argv, "qh:p")) != -1)
|
||||||
{
|
{
|
||||||
if (!strcmp(argv[i], "-q")) silent = 1;
|
switch (c)
|
||||||
if (*argv[i] == '-')
|
|
||||||
{
|
{
|
||||||
i++;
|
case 'q':
|
||||||
continue;
|
silent = 1; break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break; /*ignore */
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
if (optind < argc)
|
||||||
|
{
|
||||||
|
while (optind < argc)
|
||||||
{
|
{
|
||||||
if (config)
|
if (config)
|
||||||
{
|
{
|
||||||
if (!silent)
|
if (!silent)
|
||||||
fprintf(stderr, "warning: using %s\n", argv[i]);
|
fprintf(stderr, "warning: using %s\n", argv[optind]);
|
||||||
free(config);
|
free(config);
|
||||||
}
|
}
|
||||||
config = strdup(argv[i]);
|
config = strdup(argv[optind]);
|
||||||
|
optind++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
create_config();
|
create_config();
|
||||||
|
|
||||||
/* signal handlers */
|
/* signal handlers */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user