Re: [kvm-unit-tests PATCH V3 1/5] scripts/runtime: Add ability to mark test as don't run by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2016-08-16 14:00+0200, Andrew Jones:
> On Tue, Aug 16, 2016 at 05:18:11PM +1000, Suraj Jitindar Singh wrote:
>> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
>> @@ -32,6 +32,26 @@ get_cmdline()
>> +skip_nodefault()
>> +{
>> +    while true; do
>> +        read -p "Test marked not to be run by default, are you sure (Y/N)? " yn

I'd write "run this test" instead of "are you sure", or something
similar for the question.  The user can be sure that the has is marked
with nodefault. ;)

>> +        case $yn in
>> +            "Y" | "y" | "Yes" | "yes")
> 
> What about "YES" :-)

And exclamation marks!

"YES!!!"

> Actually, I'd just accept 'Y' for yes, and nothing else, like the prompt says.

NO.  If it is only one value, then make it "y".
motto: saving the Earth, one shift at a time.

This kind of user interface usually accepts at least "[yY]|[yY]es" ...
users will already be pissed that they have to input something and
denying a perfectly logical "yes" (which is what "y" stands for) is
going too overboard, IMO.

> And, instead of looping for valid input, all other input can just mean no.

"y/N" is the convention for writing a bool question that defaults to no.
I'd accept "" (just enter) as the default and then, looping isn't
unexpected and user already typed some crap in that case, so they
probably want to answer the question without having to run the command
again.

>> +                return 1
>> +                ;;
>> +            "N" | "n" | "No" | "no" | "q" | "quit" | "exit")
> 
> We should output something when the answer is 'no' like "User aborted",
> or whatever.
> 
>> +                exit

Wouldn't "return 1" and the SKIP message be enough?

>> +                ;;
>> +            *)
>> +                echo Please select Y or N

Just asking the question again is more common -- it's not hard to figure
out that the answer was not accepted.
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux