diff --git a/groundStation/src/cli/cli_getpid.c b/groundStation/src/cli/cli_getpid.c index c95ad1248d3e4c559bad6be5b4130b4816c93b7f..c57d42a52227bbb39d2fbceb40c182ab58a723ec 100644 --- a/groundStation/src/cli/cli_getpid.c +++ b/groundStation/src/cli/cli_getpid.c @@ -42,7 +42,7 @@ int cli_getpid(struct backend_conn * conn, int argc, char **argv) { } } - if(needHelp) { + if (needHelp) { printf("Getpid gets the p, i , or d constant values of any single controller\n"); printf("Usage Syntax : \n\t./Cli getpid controller [options...]\n"); printf("Symlink Usage Syntax : \n\t./getpid controller [options...]\n\n"); @@ -57,6 +57,11 @@ int cli_getpid(struct backend_conn * conn, int argc, char **argv) { return 0; } + if (argc < 2) { + printf("Incorrect Usage, run './cli getpid --help' for correct usage.\n"); + return 1; + } + int result; if(getAll) { pid_data.controller = PID_ROLL; diff --git a/groundStation/src/cli/cli_setpid.c b/groundStation/src/cli/cli_setpid.c index cbe6f933214f4b0fd8c6b30e75758c19c6472e85..f9c54c063e043a59b490855912d4d5fbb5d35c73 100644 --- a/groundStation/src/cli/cli_setpid.c +++ b/groundStation/src/cli/cli_setpid.c @@ -73,6 +73,11 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) { return 0; } + if (argc < 2) { + printf("Incorrect Usage, run './cli setpid --help' for correct usage.\n"); + return 1; + } + if (setRoll) { pid_data.controller = PID_ROLL; } else if (setYaw) {