add a chdir from cli opt
This commit is contained in:
parent
eb74809d59
commit
5ebc44a9be
@ -116,14 +116,18 @@ int main(int argc, char * argv[])
|
|||||||
int opt = 0;
|
int opt = 0;
|
||||||
int foo;
|
int foo;
|
||||||
char *audiodevice = "none";
|
char *audiodevice = "none";
|
||||||
|
char *newdir = NULL;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "d:hx")) != -1) {
|
while ((opt = getopt(argc, argv, "d:hs:x")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'd':
|
case 'd':
|
||||||
audiodevice = optarg;
|
audiodevice = optarg;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
help_cli(argv[0]); break;
|
help_cli(argv[0]); break;
|
||||||
|
case 's':
|
||||||
|
newdir = optarg;
|
||||||
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
fprintf(stderr, "no crash available\n");
|
fprintf(stderr, "no crash available\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -133,7 +137,16 @@ while ((opt = getopt(argc, argv, "d:hx")) != -1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, "audio device = %s\n", audiodevice);
|
fprintf(stderr, "audio device = %s\n", audiodevice);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (NULL != newdir) {
|
||||||
|
#if DEBUG_LEVEL
|
||||||
|
fprintf(stderr, "newdir = '%s'\n", newdir);
|
||||||
|
#endif
|
||||||
|
foo = chdir(newdir);
|
||||||
|
}
|
||||||
|
|
||||||
foo = init_sound_output(audiodevice, 0);
|
foo = init_sound_output(audiodevice, 0);
|
||||||
if (foo) {
|
if (foo) {
|
||||||
|
Loading…
Reference in New Issue
Block a user