2017-09-21 12:51:18 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "libp2p/utils/logger.h"
|
2016-10-31 16:13:42 +00:00
|
|
|
#include "ipfs/commands/cli/parse.h"
|
2016-10-27 18:11:34 +00:00
|
|
|
|
2017-09-21 12:51:18 +00:00
|
|
|
|
|
|
|
/***
|
|
|
|
* Parse command line arguments, and place them in a Command struct
|
|
|
|
* @param argc number of arguments
|
|
|
|
* @param argv arguments
|
|
|
|
* @param inStream an incoming stream (not implemented yet)
|
|
|
|
* @param cmd the Command struct to allocate
|
|
|
|
* @param request not sure what this is for yet
|
|
|
|
* @returns true(1) on success, false(0) otherwise
|
|
|
|
*/
|
|
|
|
int cli_parse(int argc, char** argv, FILE* inStream, struct Command** cmd, struct Request* request) {
|
|
|
|
*cmd = (struct Command*) malloc(sizeof(struct Command));
|
|
|
|
if (*cmd == NULL) {
|
|
|
|
libp2p_logger_error("parse", "Unable to allocate memory for the command structure.\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2016-10-27 18:11:34 +00:00
|
|
|
return 0;
|
|
|
|
}
|