ipfs name command line options processing

This commit is contained in:
jmjatlanta 2017-09-21 07:51:18 -05:00
parent a907f1dd2d
commit 2051f7714a
18 changed files with 278 additions and 53 deletions

19
include/ipfs/cmd/cli.h Normal file
View file

@ -0,0 +1,19 @@
#pragma once
/**
* Helps parse the command line.
*/
/**
* A structure to hold the command line arguments
*/
struct CliArguments {
int argc;
char** argv;
int verb_index;
char* config_dir;
};
struct CliArguments* cli_arguments_new(int argc, char** argv);
void cli_arguments_free(struct CliArguments* args);

View file

@ -20,4 +20,12 @@ int ipfs_cmd_ipfs_init_command_new(struct Command* command);
*/
int ipfs_cmd_ipfs_init_command_free(struct Command* command);
/***
* Parse the command line
* @param argc the number of arguments
* @param argv the actual arguments
* @returns a command structure
*/
struct Command* ipfs_cmd_parse_command_line(int argc, char** argv);
#endif