[Assword] Proposal for an extensible command line syntax

Olivier Guerrier olivier at guerrier.com
Thu Oct 24 17:28:21 EDT 2013


Hi,

I've reordered a little bit the quotes from your mail.

On 24/10/2013 20:26, Daniel Kahn Gillmor wrote:
> i'm not sure i understand what we gain from this UI reorganization on
> its own.

For sure nothing. If the plan it to keep the software as it is, then 
there is nothing to gain. This is why I did not send a patch for it.
It is not available anyway, but the goal would be to commit such 
reorganization only a few seconds before the first feature that will 
extend it.

It is normal and expected (imho) that such software will got new 
features from contributions. And such features will need to be triggered 
through command line or gui, or even environnement variables :p

 > I like this idea of consistent convention even though i personally
 > dislike the --longarg UI conventions when environment variables and
 > subcommand syntax seem cleaner to me.

The truth is there are almost as much use cases as there are users. You 
like environnement vars, I never use them, and tend to use --longarg 
only ...

Someone else might want to use configuration file ...

The first idea is to define something homogeneous, so all coming 
features will be available from all interfaces. In a consistent way.

I only described here what is necessary to make assword works as it does 
today. I think it is enough to validate the template.

More options will come with new features, but such features should be 
discussed as separates topics.

> it sounds like you are motivated by some larger goal, and you
> think this is a step on the way to that goal.  but the goal itself is
> unclear to me.

Correct. I'm using assword since 6 months on a regular basis, with 
several patches of my own that came along the way, but without the 
above'organization'. Now I plan to spend time to rework this in a better 
way that should make sense upstream.

 > what existing commands would not
 > work under the changes you're proposing (i.e. what
 > backward-compatibility breakage do you forsee?)

No features will be removed, the "breakage" comes only from some 
renaming or syntax change. ie if you were using 
ASSWORD_DUMP_PASSWORDS=whatever, you would need to switch to 
ASSWORD_FORMAT=json+pw

What you get today with 'assword gui' would be achieved tomorrow with 
either:
$ assword --ui=gtk paste
or
$ ASSWORD_UI=gtk assword paste

Everything possible today would still an equivalent.

> perhaps if you explained the larger goal, we could see if there is a way
> to get there without breaking backward compatibility, or we could better
> understand the reason for your proposed changes.
[...]
> can you give an example of what specific commands would work under your
> proposed changes that wouldn't work under the old situation?  (i.e. what
> new features are you proposing?)

I'm missing time to provide a full list of features today, but I will 
list a few examples of what I would like to do with assword.

Create a new random password:
$ assword --pwlen=16 --input=random add <context>

Import a list of passwords from a text file:
$ cat pw.txt | while read AC PW; do echo $PW | assword --input=stdin add 
$AC; done

Update manually a password:
$ assword edit <context>
(add and edit are very close, except add is not supposed to overwrite an 
existing context)

I also plan to add a 'paste' field into each record. This field would be 
optionnal (so we keep a full backward compatibility, if not specified, 
assword use the env/config/cmdline <method>.

So for example we can tell one context is meant to be use only though xclip:
$ assword --pwpaste=xclip --input=random add <context>
$ assword --pwpaste=xclip edit <context>
('pwpaste' is not the same as 'paste' as we don't want to create all 
records with the value put in ASSWORD_PASTE)

Another feature I have in mind is to have some automatic grouping of 
contexts, to manage more complex cases:
$ assword --pwpaste=xdo add mybank/myusername
$ assword --pwpaste=popup add mybank/mypin

For example my bank use a 'virtual' keyboard I have to click to ...
and here I can just call:
$ assword --ui=gtk dump mybank
and I will get both the username typed though xdo _and_ the pin 
displayed on screen ...

And yes I plan to add a paste method to display a popup, it is not fully 
clear what is the best way to implement it, but let's call it 'popup' 
for now.

Hope this helps
-- 
Olivier Guerrier
+33 6 83 93 08 46


More information about the Assword mailing list