Skip to content
Snippets Groups Projects
Unverified Commit 7d01f2b1 authored by Jake Drahos's avatar Jake Drahos
Browse files

Added support for symlinks

parent 9e5f1e26
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include <string.h>
#include <err.h>
#include <libgen.h>
#include "cli.h"
......@@ -11,7 +12,7 @@ int main(int argc, char **argv)
int i , useSymlink = 0;
struct backend_conn *conn;
command = argv[0];
command = basename(argv[0]);
for(i = 0; i < MAX_COMMANDS; ++i) {
if (strncmp(command, commandNames[i], strlen(commandNames[i])) == 0)
{
......@@ -42,11 +43,11 @@ int main(int argc, char **argv)
}
if(useSymlink) {
//TODO Call correct command function pointer with (argv[1] ... argc[argc])
(*cli_functions[cmdID]) (conn, argc, &argv[0]);
}else {
(*cli_functions[0]) (conn, argc-1, &argv[1]);
(*cli_functions[cmdID]) (conn, argc-1, &argv[1]);
}
ucart_backendDisconnect(conn);
return 0;
}
\ No newline at end of file
}
......@@ -6,7 +6,6 @@
// #include "cli_setpid.h"
#include "cli_getpid.h"
// #include "cli_getimu.h"
enum CommandNameIds{
CMD_MONITOR,
CMD_SETPID,
......@@ -31,4 +30,4 @@ static char* commandNames[MAX_COMMANDS] = {
};
#endif
\ No newline at end of file
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment