summaryrefslogtreecommitdiff
path: root/src/util/libgsmd-tool.c
diff options
context:
space:
mode:
authortick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-11-20 04:19:04 +0000
committertick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-11-20 04:19:04 +0000
commitce08f5ee38bca622527551b28678f4e3a283fca1 (patch)
tree73ba910311c89cc779996d57ce1960abda45b243 /src/util/libgsmd-tool.c
parent6ad8e1931d2df52ff173e4b83a5c3c0e1812b931 (diff)
[gsmd] Adding waiting mode for libgsmd-tool shell. (Andrzej Zaborowski)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3448 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util/libgsmd-tool.c')
-rw-r--r--src/util/libgsmd-tool.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/util/libgsmd-tool.c b/src/util/libgsmd-tool.c
index c48bf8e..d29dfdc 100644
--- a/src/util/libgsmd-tool.c
+++ b/src/util/libgsmd-tool.c
@@ -74,6 +74,7 @@ static struct option opts[] = {
{ "verbose", 0, 0, 'v' },
{ "mode", 1, 0, 'm' },
{ "pin", 1, 0, 'p' },
+ { "wait", 0, 0, 'w' },
{ 0, 0, 0, 0 }
};
@@ -84,20 +85,21 @@ static void help(void)
"\t-V\t--version\tPrint version number\n"
"\t-v\t--verbose\tBe more verbose\n"
"\t-m\t--mode\tSet mode {shell,eventlog,atcmd}\n"
+ "\t-w\t--wait\tIn shell mode wait for responses on exit\n"
);
}
int main(int argc, char **argv)
{
char *pin = NULL;
- int rc, i, mode;
+ int rc, i, mode, shellwait = 0;
printf("libgsm-tool - (C) 2006 by Harald Welte\n"
"This program is Free Software and has ABSOLUTELY NO WARRANTY\n\n");
while (1) {
int c, option_index = 0;
- c = getopt_long(argc, argv, "vVhm:p:", opts, &option_index);
+ c = getopt_long(argc, argv, "vVhwm:p:", opts, &option_index);
if (c == -1)
break;
@@ -122,6 +124,9 @@ int main(int argc, char **argv)
case 'p':
pin = optarg;
break;
+ case 'w':
+ shellwait = 1;
+ break;
}
}
@@ -139,7 +144,7 @@ int main(int argc, char **argv)
atcmd_main(lgsmh);
break;
case MODE_SHELL:
- shell_main(lgsmh);
+ shell_main(lgsmh, shellwait);
break;
}
personal git repositories of Harald Welte. Your mileage may vary