Hmmm ..... I think this spec has to change. Commit should be allowed in the non-interactive mode also. If all changes are implicitly committed, then it means calling nwam_*_commit() after every "set" subcommand in file and command line mode, This is quite inefficient.
Also, nwamcfg makes very little distinction between where it is getting the commands from. It doesn't care if the commands come from the interactive user or a file or command line. Also, the command file uses "end" to save and go up one scope (end implicitly calls commit). In command-line mode, the commit is implicit after the last command, but the user should be allowed to explicitly commit anytime. (command-line mode is typing commands after "nwamcfg" at the prompt, eg. $nwamcfg list or $nwamcfg "select ncp user; list") Let's revisit where I think the commands should be allowed. The current implementation in the gate may be different than what's listed below. cancel: all three modes (interactive, file, command-line) clear: all three modes commit: all three modes create: all three modes destroy: all three modes end: all three modes get: all three modes select: all three modes set: all three modes export: command-line and interactive mode help: command-line and interactive (doesn't make sense in file mode) list: command-line and interactive (file mode too? maybe script wants to parse output?) exit: interactive mode only revert: interactive only verify: interactive only walkprop: interactive mode only Anurag Lizhong Li wrote: > Anurag, > > According the manpage > http://opensolaris.org/os/project/nwam/p1spec/ui/CLI/, > commit is only meaningful in interactive mode, so I think the following > command should exit with an error, or are there other consideration I > don't know ? > > firering:exp# nwamcfg "select ncp myncp1; commit" > firering:exp# echo $? > 0 > firering:exp# uname -v > nwam1-build:2008-12-18 > >
