2016-10-27 13:11:34 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2016-10-31 11:13:42 -05:00
|
|
|
#include "ipfs/commands/command_option.h"
|
2016-10-27 13:11:34 -05:00
|
|
|
|
2016-11-10 08:28:51 -05:00
|
|
|
int commands_command_option_init(struct CommandOption* option, char* description) {
|
2016-10-27 13:11:34 -05:00
|
|
|
option->description = description;
|
|
|
|
// allocate memory for names
|
|
|
|
option->names = malloc(option->name_count * sizeof(char*));
|
|
|
|
if (option->names == NULL)
|
|
|
|
return 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2016-11-10 08:28:51 -05:00
|
|
|
int commands_command_option_free(struct CommandOption* option) {
|
2016-10-27 13:11:34 -05:00
|
|
|
free(option->names);
|
2016-11-28 08:09:00 -05:00
|
|
|
free(option);
|
2016-10-27 13:11:34 -05:00
|
|
|
return 0;
|
|
|
|
}
|