projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
53ddba8
)
cli: don't commit, if the savedir was overwritten
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 3 Feb 2008 03:44:57 +0000
(
04:44
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 3 Feb 2008 03:44:57 +0000
(
04:44
+0100)
cli.c
patch
|
blob
|
history
diff --git
a/cli.c
b/cli.c
index
45a105a
..
bfbb92c
100644
(file)
--- a/
cli.c
+++ b/
cli.c
@@
-17,8
+17,9
@@
static const char *appname = "uci";
static enum {
static const char *appname = "uci";
static enum {
- CLI_FLAG_MERGE = (1 << 0),
- CLI_FLAG_QUIET = (1 << 1)
+ CLI_FLAG_MERGE = (1 << 0),
+ CLI_FLAG_QUIET = (1 << 1),
+ CLI_FLAG_NOCOMMIT = (1 << 2),
} flags;
static FILE *input;
} flags;
static FILE *input;
@@
-107,6
+108,8
@@
static int package_cmd(int cmd, char *package)
return 0;
switch(cmd) {
case CMD_COMMIT:
return 0;
switch(cmd) {
case CMD_COMMIT:
+ if (flags & CLI_FLAG_NOCOMMIT)
+ return 0;
if (uci_commit(ctx, &p, false) != UCI_OK)
cli_perror();
break;
if (uci_commit(ctx, &p, false) != UCI_OK)
cli_perror();
break;
@@
-349,6
+352,7
@@
int main(int argc, char **argv)
case 'P':
uci_add_history_path(ctx, ctx->savedir);
uci_set_savedir(ctx, optarg);
case 'P':
uci_add_history_path(ctx, ctx->savedir);
uci_set_savedir(ctx, optarg);
+ flags |= CLI_FLAG_NOCOMMIT;
break;
case 'q':
flags |= CLI_FLAG_QUIET;
break;
case 'q':
flags |= CLI_FLAG_QUIET;