Re: [PATCH 0/6] Add new option: --next-clip,-C for commands: `generate`,`show` that will enable using an alternative clipboard than the default

2018-02-09 Thread Doron Behar
On Wed, Feb 07, 2018 at 11:36:29PM +, Tobias Girstmair wrote:
> I'm confused as to why this patch comes to be. Using the env.var works quite 
> well to set which selection pass shall use. (e.g. 
> `PASSWORD_STORE_X_SELECTION=primary pass -c git` puts my git password into 
> the primary (== middle click) selection as expected)

This patch is necessary in my view because if you want to put a password
in the `PRIMARY` clipboard, typing `$PASSWORD_STORE_X_SELECTION` is a
lot to type and having this env.var as the only option that can affect
this is not comfortable enough.
I didn't suggest that this method is not working.

> 
> about the patch itself:
> - renaming the env.var seems (to me) more trouble than it's worth, as it'll 
> break many `.${SHELL}rc` files, while not providing much extra value
You are right, I gave it some more thought after I sent the patch and I
agree that the env.var name doesn't really have to change, I just
thought to myself that in it's new effect the new name reflects it's
purpose better.
> - the parameter `--next-clip` isn't named self-explainatory (why not 
> something with `primary` in the name?)
I've just talked about it with Radon Rosborough 
and after giving it a second thought, perhaps naming the new options
`-p,--prim` is better and this way we don't need
`$PASSWORD_STORE_X_SELECTION` or `$PASSWORD_DEFAULT_STORE_X_SELECTION`.
> - I have to admit that i've just glanced over that patch, but are you 
> `shift`ing out the argument? I've noticed for example "Copied $2 "... 
> changing into "Copied $3"...
Yes I do, in the current version of the patch, `clip()` accepts 3
arguments.

> 
> I'm against this patch, mostly because I believe that most people are just 
> using one of the two clipboards/selections, and that is better set using an 
> alias. (I'd be glad to be proven wrong through)

I'm using `pass` mostly for websites and for some desktop passwords as
well. When I use it for shell programs on a terminal emulator (Urxvt in
my case), I occasionally need to enter a password in a prompt and the
PRIMARY clipboard is respected with Shift-Insert which is the keybinding
I'm most used to.

> 
> -- 
> 
> greetings, tobias
> 
> 
> 
> 
> 
> 
> Doron Behar  schrieb am 20:40 Mittwoch, 7.Februar 2018:
> 
> 
> 
> A few days ago I asked in this mailing list whether anyone would be
> interested in a new option for `cmd_show()` (the default command) and
> `cmd_generate()` that will enable users to use the **non-default**
> clipboard in these commands - meaning that if someone usually uses the
> `clipboard` selection, with the new option he will be able to use
> `primary`.
> 
> In this implementation I added the options `-C,--next-clip` to the
> commands `cmd_show()` `cmd_generate()`.
> 
> In addition, I changed the environmental variable
> `$PASSWORD_STORE_X_SELECTION` to `$PASSWORD_STORE_DEFAULT_X_SELECTION`
> because after these changes, (since the clipboard can be changed in the
> command line) an environmental variable like this should tell `pass`
> only the *default* choice. If backwards incompatibility is a problem in
> my implementation I guess we can revert and use the old environmental
> variable.
> 
> There is still some work left to do - documentation and shell
> completion, but I would like to know your responses before completing
> these tasks.
> 
> Commits summary:
> 
> Doron Behar (6):
>   Don't evaluate a global X_SELECTION variable.
>   Decide what clipboard to use in `clip()`.
>   Add all of `nextclip` variable where relevant.
>   Add the new option to `getopt`'s invocations.
>   Add new option to usage.
>   Small fix to `cmd_show()` getopt usage.
> 
> src/password-store.sh | 56 +++
> 1 file changed, 39 insertions(+), 17 deletions(-)
> 
> -- 
> 2.16.1
> 
> ___
> Password-Store mailing list
> Password-Store@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/password-store


signature.asc
Description: PGP signature
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store


Re: [PATCH 0/6] Add new option: --next-clip,-C for commands: `generate`, `show` that will enable using an alternative clipboard than the default

2018-02-08 Thread Doron Behar
You are right, I forgot about your comment when I started to actually
add this feature.

How about `-p` and `--prim`? It could be very symmetric to `-c` and
`--clip`. Now that I'm thinking about it, perhaps this way we don't even
need `$PASSWORD_STORE_DEFAULT_X_SELECTION` or
`$PASSWORD_STORE_X_SELECTION` and the code will be even simpler. It will
be even easier to document the new behaviour since we just need to say
that `-c,--clip` puts the password in the `CLIPBOARD` selection and
`-p,--prim` puts it in the `PRIMARY` clipboard selection.

As for the matter regarding Mac OSx users, I think it's OK if on these
machines it won't matter whether the user uses `-p,--prim` or
`-c,--clip`. BTW, this new option doesn't make the code much more
complicated as for OS compatibilities because there is already an OSx
specific implementation of the `clip` function. This function suffered
most of the changes I made.

On Wed, Feb 07, 2018 at 10:13:40PM -0800, Radon Rosborough wrote:
> I think using -C for this is a bad idea since the conventional meaning
> of -C is to allow changing the working directory, and I think this
> would be a useful feature for Password Store (because it seems rather
> odd to me that the path to ~/.password-store is completely hardcoded).
> I like the actual feature, I just think it should use a different
> short option.
> 
> Best,
> Radon Rosborough
> ___
> Password-Store mailing list
> Password-Store@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/password-store


signature.asc
Description: PGP signature
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store


Re: [PATCH 0/6] Add new option: --next-clip,-C for commands: `generate`, `show` that will enable using an alternative clipboard than the default

2018-02-07 Thread Radon Rosborough
I think using -C for this is a bad idea since the conventional meaning
of -C is to allow changing the working directory, and I think this
would be a useful feature for Password Store (because it seems rather
odd to me that the path to ~/.password-store is completely hardcoded).
I like the actual feature, I just think it should use a different
short option.

Best,
Radon Rosborough
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store


Re: [PATCH 0/6] Add new option: --next-clip,-C for commands: `generate`,`show` that will enable using an alternative clipboard than the default

2018-02-07 Thread Tobias Girstmair
I'm confused as to why this patch comes to be. Using the env.var works quite 
well to set which selection pass shall use. (e.g. 
`PASSWORD_STORE_X_SELECTION=primary pass -c git` puts my git password into the 
primary (== middle click) selection as expected)

about the patch itself:
- renaming the env.var seems (to me) more trouble than it's worth, as it'll 
break many `.${SHELL}rc` files, while not providing much extra value
- the parameter `--next-clip` isn't named self-explainatory (why not something 
with `primary` in the name?)
- I have to admit that i've just glanced over that patch, but are you 
`shift`ing out the argument? I've noticed for example "Copied $2 "... changing 
into "Copied $3"...

I'm against this patch, mostly because I believe that most people are just 
using one of the two clipboards/selections, and that is better set using an 
alias. (I'd be glad to be proven wrong through)

-- 

greetings, tobias






Doron Behar  schrieb am 20:40 Mittwoch, 7.Februar 2018:



A few days ago I asked in this mailing list whether anyone would be
interested in a new option for `cmd_show()` (the default command) and
`cmd_generate()` that will enable users to use the **non-default**
clipboard in these commands - meaning that if someone usually uses the
`clipboard` selection, with the new option he will be able to use
`primary`.

In this implementation I added the options `-C,--next-clip` to the
commands `cmd_show()` `cmd_generate()`.

In addition, I changed the environmental variable
`$PASSWORD_STORE_X_SELECTION` to `$PASSWORD_STORE_DEFAULT_X_SELECTION`
because after these changes, (since the clipboard can be changed in the
command line) an environmental variable like this should tell `pass`
only the *default* choice. If backwards incompatibility is a problem in
my implementation I guess we can revert and use the old environmental
variable.

There is still some work left to do - documentation and shell
completion, but I would like to know your responses before completing
these tasks.

Commits summary:

Doron Behar (6):
  Don't evaluate a global X_SELECTION variable.
  Decide what clipboard to use in `clip()`.
  Add all of `nextclip` variable where relevant.
  Add the new option to `getopt`'s invocations.
  Add new option to usage.
  Small fix to `cmd_show()` getopt usage.

src/password-store.sh | 56 +++
1 file changed, 39 insertions(+), 17 deletions(-)

-- 
2.16.1

___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store