Ah, I had missed the "list_cb()" callback, which correctly receives each (key, value) pair in a list.
Still, I don't think receiving "import_table_ITEM1" and "import_table_LENGTH" in the "option_cb()" is correct. I'm not sure whether it comes from this shell script: http://git.openwrt.org/?p=openwrt.git;a=blob;f=package/base-files/files/lib/functions.sh;h=0d4b2a33dbbf4e18acd474ae2adaad0ea3c1c4a0;hb=HEAD or from uci itself. Any clue? On Wed, Aug 27, 2014 at 07:11:39PM +0200, Baptiste Jonglez wrote: > Hi, > > According to [1], it should be possible to parse list of options in a UCI > file using an "option_cb()" callback. > > It does not seem to work as expected, for instance this block: > > config example > list 'import_table' '42' > list 'import_table' '53' > > leads to the following calls: > > config_cb example cfg02f223 > option_cb import_table_ITEM1 42 > option_cb import_table_LENGTH 1 > option_cb import_table_ITEM2 53 > option_cb import_table_LENGTH 2 > > I would have simply expected multiple calls to option_cb() with > "import_table" as the first argument and the various value as the second > argument. Is this intended? > > Thanks, > Baptiste > > [1] http://wiki.openwrt.org/doc/devel/config-scripting#callbacks > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
pgpprvKLsTz63.pgp
Description: PGP signature
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel