- uci_list_empty(&cfg->sections);
- uci_foreach_entry(section, &cfg->sections, p) {
- uci_show_section(p);
+ for (p = configs; *p; p++) {
+ if ((argc < 2) || !strcmp(argv[1], *p)) {
+ if (uci_load(ctx, *p, &package) != UCI_OK) {
+ uci_perror(ctx, "uci_load");
+ return 255;
+ }
+ uci_foreach_element( &package->sections, e) {
+ if (!section || !strcmp(e->name, section))
+ uci_show_section(uci_to_section(e));
+ }
+ uci_unload(ctx, *p);
+ }