X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=cli.c;h=02a34c0d6e40e955aa95233f2e11f2587b2792c3;hp=946a90553242efff1ca2f201c459479a35909385;hb=b809dbd44309be056a7ce96b18a418fb51641cce;hpb=65e2c3559b451315935f9483c5f4e59d63441e54 diff --git a/cli.c b/cli.c index 946a905..02a34c0 100644 --- a/cli.c +++ b/cli.c @@ -12,16 +12,21 @@ * GNU General Public License for more details. */ #include +#include #include #include #include "uci.h" -static const char *appname = "uci"; +#define MAX_ARGS 4 /* max command line arguments for batch mode */ + +static const char *appname; static enum { CLI_FLAG_MERGE = (1 << 0), CLI_FLAG_QUIET = (1 << 1), CLI_FLAG_NOCOMMIT = (1 << 2), + CLI_FLAG_BATCH = (1 << 3), } flags; + static FILE *input; static struct uci_context *ctx; @@ -34,18 +39,28 @@ enum { CMD_REVERT, /* package cmds */ CMD_SHOW, - CMD_IMPORT, + CMD_CHANGES, CMD_EXPORT, CMD_COMMIT, + /* other cmds */ + CMD_ADD, + CMD_IMPORT, + CMD_HELP, }; -static void uci_usage(int argc, char **argv) +static int uci_cmd(int argc, char **argv); + +static void uci_usage(void) { fprintf(stderr, "Usage: %s [] []\n\n" "Commands:\n" + "\tbatch\n" "\texport []\n" "\timport []\n" + "\tchanges []\n" + "\tcommit []\n" + "\tadd \n" "\tshow [[.
[.