file: Fix uci -m import command
[project/uci.git] / cli.c
diff --git a/cli.c b/cli.c
index 267437d096d227519220380b698a164b216dc94c..b4c4f9574b4daf1948a3e4be703ee48cd75fd5e6 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -167,6 +167,7 @@ static void uci_usage(void)
                "\t-N         don't name unnamed sections\n"
                "\t-p <path>  add a search path for config change files\n"
                "\t-P <path>  add a search path for config change files and use as default\n"
+               "\t-t <path>  set save path for config change files\n"
                "\t-q         quiet mode (don't print error messages)\n"
                "\t-s         force strict mode (stop on parser errors, default)\n"
                "\t-S         disable strict mode\n"
@@ -706,7 +707,7 @@ int main(int argc, char **argv)
                return 1;
        }
 
-       while((c = getopt(argc, argv, "c:d:f:LmnNp:P:sSqX")) != -1) {
+       while((c = getopt(argc, argv, "c:d:f:LmnNp:P:qsSt:X")) != -1) {
                switch(c) {
                        case 'c':
                                uci_set_confdir(ctx, optarg);
@@ -747,13 +748,15 @@ int main(int argc, char **argv)
                                uci_add_delta_path(ctx, optarg);
                                break;
                        case 'P':
-                               uci_add_delta_path(ctx, ctx->savedir);
                                uci_set_savedir(ctx, optarg);
                                flags |= CLI_FLAG_NOCOMMIT;
                                break;
                        case 'q':
                                flags |= CLI_FLAG_QUIET;
                                break;
+                       case 't':
+                               uci_set_savedir(ctx, optarg);
+                               break;
                        case 'X':
                                flags &= ~CLI_FLAG_SHOW_EXT;
                                break;