Page 1 of 1
UI Style Guide Shell WIKI - templates
Posted: Wed May 11, 2016 9:57 pm
by xenic
I noticed that the template for the requestchooser command in the A-EON enhancer package has 3 string arguments without a required keyword (/K). That means that if you enter args in the wrong order or leave out one of the string args you will get a requester with text in the wrong places. It seems to me that only one string arg should have no keyword required and any other string arguments should have /K (keyword required) so that the arguments can be entered in any order.
I think the UI Style Guide Shell WIKI should be updated to recommend that templates should only have one string keyword that doesn't require a keyword and any other string keywords should be marked /K (keyword required).
Re: UI Style Guide Shell WIKI - templates
Posted: Thu May 12, 2016 11:00 pm
by thomasrapp
There is nothing wrong with the template. An absent /K does not mean you may not use keywords, you just don't need to specify them. If you want to reorder the arguments, you can still use the keywords.
For example if the template is TITLE,BODY,BUTTON
you can use: Greetings "Hello World" Ok
but you can as well use: BUTTON Ok TITLE Greetings BODY "Hello World!"
/K should only be used if it avoids confusion, it should not create it.
For example with the standard RequestChoice command:
requestchoice a b c d
is absolutely valid and does not need any keywords (a is title, b is body and c and d are buttons). No need for /K.
Re: UI Style Guide Shell WIKI - templates
Posted: Sat May 14, 2016 1:04 am
by xenic
thomasrapp wrote:There is nothing wrong with the template. An absent /K does not mean you may not use keywords, you just don't need to specify them. If you want to reorder the arguments, you can still use the keywords.
For example if the template is TITLE,BODY,BUTTON
you can use: Greetings "Hello World" Ok
but you can as well use: BUTTON Ok TITLE Greetings BODY "Hello World!"
/K should only be used if it avoids confusion, it should not create it.
For example with the standard RequestChoice command:
requestchoice a b c d
is absolutely valid and does not need any keywords (a is title, b is body and c and d are buttons). No need for /K.
On the other hand "RequestFIle" has one string argument that doesn't require a keyword and all the remaining string arguments require the keyword. It's less confusing than remembering in what order multiple string args must be entered. I didn't say there was anything wrong with the template; I'm suggesting that a recommendation that "multiple string arguments except one have a required keyword" be added to the style guide WIKI.
Re: UI Style Guide Shell WIKI - templates
Posted: Sat May 14, 2016 1:16 pm
by broadblues
I don't see your logic, templates are design to work the way they are being used in RequestChoise (which I coppied over inot RequestChooser).
IMHO (and this is just MHO) keywords should be used when there is a default value to override
eg for a 'save' arrex function where the default is the current filename I might do
SAVEIMAGE FILENAME/K
but for a 'save as' where a new file must always be chosen
SAVEIMAGEAS FILENAME/A
Other combinataion and intreptations are valid.
Re: UI Style Guide Shell WIKI - templates
Posted: Sun May 15, 2016 7:57 pm
by xenic
broadblues wrote:I don't see your logic
The logic is to make shell commands as errorproof as possible. My proposal applies to current AmigaDOS
commands as well. Consider the copy command:
The copy command doesn't require a keyword for the "TO" argument. If the user intends to replace a file by copying ram:myfile to dh0:myfile and accidently reverses the argument order (copy dh0:myfile ram:myfile) then he has lost the file he actually wanted to copy. In addition, the from argument has a "/M" option which means that entering multiple names and forgetting to enter the TO keyword would produce unpredictable results. If the template for the TO argument were " TO/K/A " potential errors could be avoided.
What I proposed was a recommendation in the WIKI and not a requirement.
Re: UI Style Guide Shell WIKI - templates
Posted: Mon May 16, 2016 1:17 pm
by broadblues
There no ambiguity at all in COPY with no keywords the last argument is the destination, if there is more than one src argument the destination is treated as a directory name (and created if not present).
It is in fact an excellent example of why restricting to one argument without a keywaord is abad thing.