On 06.12.2008, at 21:27, Alon Bar-Lev wrote:

> On 12/6/08, Martin Paljak <[EMAIL PROTECTED]> wrote:
>> As it affect the overall operation of pkcs11-tool (C_GetSlotList is  
>> called
>> only once during the lifetime of the tool)
>> it is justified to have it as a generic option to pkcs11-tool. I'm  
>> just not
>> sure if adding a verbose option is the right thing to do.
>> If you actually use pkcs11-tool (as a human being) one often wants  
>> to cut
>> the unnecessary noise (e.g. 13 empty virtual slots)
>> So it also makes sense to have it as a shorthand option.
>
> I understand this... But having too many options is also makes it
> difficult for people to use the tool.

I'm a firm believer in the 'explorer' approach to command line  
utilities. This means that the tools should always work and do  
something useful with minimal options and allow to tweak and expand  
the functionality in a consistent way as you learn.

>
>
>> So pkcs11-tool -TL (--list-slots --with-tokens?) is the way I'd  
>> like to
>> type it.  What do you think?
>
> OK.
> Although the name of the new parameter should be related slots... And
> I like to have a more generic parameter exactly as we have to object
> type.
Or it could be related to Tokens :) Currently pkcs11-tool options that  
are capitals deal with the module itself, or are "global" in the sense  
that they don't deal with any objects in a specific slot (except -O).
So it would also be OK to keep only the short option -T.


>> Similarly to the change in [3597] I'd like to change pkcs11-tool -O  
>> for
>> example to display all objects in all slots, unless a slot is  
>> specified.
>
> I've seen this... You mean all objects in first none empty slot...
No. All objects in all slots. With readers a casual user has one or  
maybe two readers (and N virtual OpenCT readers on Ubuntu) and from  
granularity point of view it is fair to find the first reader that has  
anything in it to process further.
But current OpenSC implementation has many slots for every card  
(default is 4) so only displaying stuff from the first slot only  
reveals half of the stuff.
>
> Well, I must say I did not like this... But it did not made any
> damage. I don't like the goto you added there.... :) Better is to
> search using another variable...
Right, I though about the goto and decided to use if only because I  
have an evil mind ;) gotos are used all over the place in opensc, so  
it doesn't matter. It's readable I hope.

>
>
> But anyway, I don't think that printing all objects in all slots is
> consistent with expected behavior.
What IS the expected behavior if you don't specify a slot at all? The  
correct answer IMO would be to exit with the error "--slot XX  
required" but that would be against the DWIM explorer style.
There's a lot of ancient cruft in OpenSC which actually sucks from  
usability point of view. Lets do some changes (of course, we need to  
document those changes...)


m.

-- 
Martin Paljak
http://martin.paljak.pri.ee
+372.515.6495




_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to