aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ipc-modem.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ipc-modem.c')
-rw-r--r--tools/ipc-modem.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/ipc-modem.c b/tools/ipc-modem.c
index 71031eb..de9910b 100644
--- a/tools/ipc-modem.c
+++ b/tools/ipc-modem.c
@@ -50,6 +50,7 @@ char call_number[14];
char sim_pin[8];
enum command {
+ CMD_NONE,
CMD_START,
CMD_BOOT,
CMD_POWER_ON,
@@ -553,7 +554,7 @@ modem_quit:
int main(int argc, char *argv[])
{
- enum command command;
+ enum command command = CMD_NONE;
int c = 0;
int opt_i = 0;
bool debug = false;
@@ -639,5 +640,14 @@ int main(int argc, char *argv[])
optind++;
}
+ if (command == CMD_NONE) {
+ printf("\n");
+ printf("Error: No command given. You need to use a command.\n");
+ printf(" See the help below for more details.\n");
+ printf("\n");
+ print_help();
+ return 1;
+ }
+
return handle_command(command, debug);
}