I am trying to build a user input and test Command line argument
but getting below error
/home/abharati/myWorkspace/Gitlab_Mobildemonstrator/ziel-i4-arbeitsprojekt/sandbox/sandcom/sandbox.c:12:28: error: implicit declaration of function ‘le_arg_GetValue’; did you mean ‘le_ref_GetValue’? [-Werror=implicit-function-declaration]
const char* argValue = le_arg_GetValue(“–test-input”);
^~~~~~~~~~~~~~~
le_ref_GetValue
Code is below,
#include “legato.h”
#include <stdio.h>
#include <errno.h>
#include <string.h>
//static void TestPath(const char* path);
COMPONENT_INIT
{
LE_INFO("Function test started");
// Get the CLI argument named --test-input
const char\* argValue = le_arg_GetValue("--test-input");
if (!argValue)
{
LE_ERROR("Missing argument --test-input");
return;
}
// Convert string to integer
int input = atoi(argValue);
if (input == 1)
{
LE_INFO("Output: true");
}
else if (input == 0)
{
LE_INFO("Output: false");
}
else
{
LE_ERROR("Invalid input: %s. Use 1 or 0.", argValue);
}
}
please guide