- Move CLI internal headers to `includes/internal/cli/` - Split CLI handler and parsing declarations across dedicated internal headers - Move handler map to `option_map.c` and properly update references - Relocate CLI utility source and test files from `utils` to `parse_utils` - Refactor `cli.h` to only expose the public interface, move internal typedefs/functions out - Update build system: add conditional git commit detection
21 lines
390 B
C
21 lines
390 B
C
#include "cli.h"
|
|
#include "internal/cli/arg_handler.h"
|
|
#include "internal/cli/parse_utils.h"
|
|
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
|
|
int
|
|
cli_handle_interval(const char *arg, t_ping_config *config)
|
|
{
|
|
float interval;
|
|
|
|
if (0 != cli_parse_float(arg, &interval))
|
|
{
|
|
dprintf(STDERR_FILENO, "Invalide interval\n");
|
|
return CLI_ERROR;
|
|
}
|
|
|
|
config->interval = interval;
|
|
return CLI_SUCCESS;
|
|
}
|