Revert "mandatory anonymous section identifier" This reverts commits: df72af474075 "mandatory anonymous section identifier" 2eb9c097e392 "cli: remove now-defunct UCI_FLAG_EXPORT_NAME support" fe45f97302cb "test: adjust for auto-naming anonymous sections" After some discussion we came to the conclusion that we need a different fix. Signed-off-by: Felix Fietkau <nbd@nbd.name>
cli: remove now-defunct UCI_FLAG_EXPORT_NAME support Preserve command line switches for compatibility reasons Signed-off-by: Felix Fietkau <nbd@nbd.name>
cli: fix uci show output for anonymous sections (#21781) Signed-off-by: Felix Fietkau <nbd@openwrt.org>
cli: suppress printing error messages when -q is specified. - Introduce cli_error() for printing local errors. - Convert existing fprintf(stderr, ) and perror() to cli_error(). - N.B. error messages will still be printed if they occured before -q flag was parsed. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
uci: properly close input before exit Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
cli: fix return value of package_cmd(). It's a bug revealed by commit 446e774 "cli: properly unload package before quit". The current code would exit with value 1 even if uci_export() succceeded. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
cli: enhance "uci show" command on nonexistent sections and options. When doing "uci show network.nilsection", the current behaviour is that uci will emit a error message complaining "Entry not found", then continue to show all content of the package network itself. This is couter-intuition. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
cli: properly unload package before quit. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
cli: fix printing option values occupying multiple lines. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Fix memory leaks found by using valgrind on test cases. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
style: free(NULL) is perfectly valid so we can drop some checks Signed-off-by: Luka Perkov <luka@openwrt.org>
remove plugin support, it has been unused for a long time and should not be used for any new code Signed-off-by: Felix Fietkau <nbd@openwrt.org>
extend delete command so it can delete list elemets using index
add new command del_list
cli: return non-zero status on errors
cli: check against multiple -f invocations to avoid leaks (patch by Stanislav Fomichev)
add a few missing null pointer checks, and fix check vs dereference order in some cases (patch by Stanislav Fomichev)
check result of memory allocations (patch by Stanislav Fomichev)
cli: do not return 0 if the command was invalid
uci_history -> uci_delta