* GNU General Public License for more details.
*/
#include <strings.h>
+#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "uci.h"
"\tbatch\n"
"\texport [<config>]\n"
"\timport [<config>]\n"
+ "\tchanges [<config>]\n"
"\tshow [<config>[.<section>[.<option>]]]\n"
"\tget <config>.<section>[.<option>]\n"
"\tset <config>.<section>[.<option>]=<value>\n"
struct uci_package *package = NULL;
char *name = NULL;
int ret = UCI_OK;
+ bool merge = false;
if (argc > 2)
return 255;
if (flags & CLI_FLAG_MERGE) {
if (uci_load(ctx, name, &package) != UCI_OK)
package = NULL;
+ else
+ merge = true;
}
ret = uci_import(ctx, input, name, &package, (name != NULL));
if (ret == UCI_OK) {
- if (flags & CLI_FLAG_MERGE) {
+ if (merge) {
ret = uci_save(ctx, package);
} else {
struct uci_element *e;
ret = uci_revert(ctx, &p, section, option);
break;
case CMD_SET:
- ret = uci_set(ctx, p, section, option, value);
+ ret = uci_set(ctx, p, section, option, value, NULL);
break;
case CMD_DEL:
ret = uci_delete(ctx, p, section, option);