X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=cli.c;h=45a105a715320de7a2052a4a098b6532890887a9;hp=2252e5e395b6061d22e1cc560bfb98e5488db078;hb=2b4872345ab2b49b521f2d7a70a8ed91dbcf7732;hpb=a1f1ee31878c71cb460126d07429eab07587d170 diff --git a/cli.c b/cli.c index 2252e5e..45a105a 100644 --- a/cli.c +++ b/cli.c @@ -12,110 +12,366 @@ */ #include #include +#include #include "uci.h" +static const char *appname = "uci"; +static enum { + CLI_FLAG_MERGE = (1 << 0), + CLI_FLAG_QUIET = (1 << 1) +} flags; +static FILE *input; + static struct uci_context *ctx; -static char *buf = NULL; -static int buflen = 256; +enum { + /* section cmds */ + CMD_GET, + CMD_SET, + CMD_DEL, + CMD_RENAME, + /* package cmds */ + CMD_SHOW, + CMD_IMPORT, + CMD_EXPORT, + CMD_COMMIT, +}; static void uci_usage(int argc, char **argv) { fprintf(stderr, "Usage: %s [] []\n\n" "Commands:\n" - "\tshow [[.
[.