2016-10-27 18:11:34 +00:00
|
|
|
/***
|
|
|
|
* methods to parse the command line parameters
|
2016-10-31 16:13:42 +00:00
|
|
|
*/
|
2016-10-27 18:11:34 +00:00
|
|
|
#ifndef __COMMANDS_CLI_PARSE_H__
|
|
|
|
#define __COMMANDS_CLI_PARSE_H__
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2016-10-31 16:13:42 +00:00
|
|
|
#include "ipfs/commands/command.h"
|
2016-10-27 18:11:34 +00:00
|
|
|
|
|
|
|
/***
|
|
|
|
* turns parameters passed in into a Request struct
|
|
|
|
* @param params the command line parameters
|
|
|
|
* @param inStream a stream (for piped input)
|
|
|
|
* @param cmd the command struct, already initialized
|
|
|
|
* @param request the end result, something that can be passed on that actually does something
|
|
|
|
* @returns 0 if something bad happens, otherwise 1
|
|
|
|
*/
|
|
|
|
int cli_parse(char** params, FILE* inStream, struct Command* cmd, struct Request* request);
|
|
|
|
|
|
|
|
int cli_parse_opts(char** params, struct Command* cmd, char* path, char** stringVals);
|
|
|
|
|
|
|
|
#endif /* parse_h */
|