Renee Danson wrote:
> On Mon, Jan 05, 2009 at 11:29:14AM -0500, Anurag S. Maskey wrote:
>   
>> Michael wrote:
>>     
>>> I think the burden should be on why are interactive and non-interactive
>>> mode different.  It seems to me like coding them to be different would
>>> actually be more work for little to no gain.  Additionally we will have
>>> to make it clear in the documentation when they are different which
>>> could be confusing unless we have strong and clear reasons.
>>>   
>>>       
>> walkprop is one command that must be exclusive to interactive mode.  This 
>> command waits for the user to enter a value and/or press "enter". 
>> The other commands (verify, revert, exit) make more sense in interactive 
>> mode, but doesn't hurt non-interactive modes if allowed.
>>     
>
> My inclination would be to say that in general, commands are allowed in
> any mode.  As Anurag points out, walkprop really does need to be the
> exception; it should be interactive-mode only.  I could go either way on
> verify, revert, and exit; probably simpler to just allow them everywhere,
> as I think Anurag was suggesting above.
>   
Yep, that was my suggestion.
>   
>> Another question related to non-interactive mode is whether nwamcfg exit at 
>> the first sign of error when in a non-interactive mode disregarding the 
>> remaining commands or continue with the remaining subcommands?
>>     
>
> I don't do a lot of scripting; but my expectation based on limited experience
> would be an exit on the first error.
>   
Some deep checking shows that nwamcfg exits on the first error when in 
command-file mode. 

nwamcfg did not exit when there are multiple commands (either through 
the command line or in interactive mode) and one of them resulted in an 
error.  I've fixed this in the last round of fixes.

Earlier implementation:

    bash-3.2# nwamcfg "select loc foo; set hosts-file=/etc/hosts"
    Select error reading object: entity not found
    set is not allowed at this scope.
    Please select the resource whose property you want to set.

    bash-3.2# nwamcfg
    nwamcfg> select loc foo; set hosts-file=/etc/host
    Select error reading object: entity not found
    set is not allowed at this scope.
    Please select the resource whose property you want to set.


Fixed implementation:

    bash-3.2# ./nwamcfg "select loc foo; set hosts-file=/etc/hosts"
    Select error reading object: entity not found
    bash-3.2# echo $?
    1

    bash-3.2# ./nwamcfg
    nwamcfg> select loc foo; set hosts-file=/etc/host
    Select error reading object: entity not foundnwamcfg> exit
    bash-3.2# echo $?
    1



Reply via email to