This is a small change which reorders/consolidates how lesspass prompts the user for the required information. Before this, if a user supplied the -p tag while also providing site, login, and or a password in the positional arguments, the prompt would ask for the values again. This instead checks for the values and skips asking if they exist. For example, lesspass sitename -p will only prompt for the login and the password
It has been pointed out by @bugaevc that a user may have X and
Wayland software available on the same system (e.g. for testing
purposes) and that the best way to determine whether to use
xsel/xclip or wl-copy is not to merely check for the presence of
these commands, but to check whether the `WAYLAND_DISPLAY`
environment variable is set. That is what this commit does.
The lesspass CLI already supports copying to the clipboard on X
window system environments if certain tools (xsel or xclip) are
installed. Many Unix-like systems have begun shipping environments
that use Wayland instead of X. xsel and xclip are not designed for
Wayland. The most widely-used clipboard tool suite for Wayland,
wl-clipboard, has an optional compatibility layer that can make it
work with the xsel and xclip commands; this may or may not be
included in packages that provide the wl-clipboard tools.
This commit gives the lesspass CLI explicit support for the wl-copy
command provided by wl-clipboard. lesspass will continue to check
for the presence of xsel and xclip before trying wl-copy, to guard
against the perhaps unlikely scenario that the user has the wl-copy
command installed on their system, but is not running a Wayland
server, in which case the command will fail.
* Deploy automatically on npm all required packages on tag
* Create a script to tag automatically and change the version number everywhere
* Bump all versions numbers to 8.0.0
* use `choices` attribute from parser.add_argument() instead of complex actions override
* use metavar to improve --help output
* use custom 'range_type' for length argument