aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2021-06-02 14:41:58 +0100
committerMiquel Lionel <lionel@les-miquelots.net>2021-06-02 14:41:58 +0100
commit50f873816808d3958a563f00eb29adc821e16dc4 (patch)
treed3cdba9e0ebcf77b5aadbd6438ea3c1b5aef6bbb
parentbd9bf50eec6f8f442627a5a60497479e99fd489e (diff)
downloadpass.bat-50f873816808d3958a563f00eb29adc821e16dc4.tar.gz
pass.bat-50f873816808d3958a563f00eb29adc821e16dc4.zip
implement the help function
- also be moar like unix counterpart: without arguments it does `pass ls`
-rw-r--r--pass.bat46
1 files changed, 26 insertions, 20 deletions
diff --git a/pass.bat b/pass.bat
index 0e6fc71..a6bcf20 100644
--- a/pass.bat
+++ b/pass.bat
@@ -1,5 +1,28 @@
@echo off
+IF ["%~1"] EQU ["help"] (
+ echo.Copyright ^(c^) 2012-2018, Jason A. Donenfeld ^<Jason@zx2c4.com^>
+ echo.Copyright ^(c^) 2019-2021, Miquel Lionel
+ echo.
+ echo.Here's the available parameters for pass. Params between [] are MANDATORY:
+ echo.
+ echo. ls - without arguments, it list the entire password store as a tree.
+ echo. show [passname] - decrypt the password with name [passname], output the result to the console
+ echo. insert [passname] - insert a password with name [passname], prompt for input. Stop and save with a newline and by pressing Ctrl+Z on your keyboard.
+ echo. rm [passname] - delete the password matching [passname]. Prompts for confirmation.
+ echo. rmf [passname] - force the deletion of password matching [passname].
+ echo. rmrf [passname] - recursively and forcefully delete a directory in the password store.
+ echo. clip [passname] [linenumber] - copy into the clipboard the text at line [linenumber] for password matching [passname].
+
+ echo.
+ echo.ENVIRONNEMENT VARIABLES:
+ echo. PASSWORD_STORE_KEY The key^(s^) ID in 0xlong form. Can alternatively be in a .gpg-id file in the password store directory, searches in it by default.
+ echo. PASSWORD_STORE_DIR The directory which contains the password, with .gpg %GPG_OPTS% extension.
+ echo. PASSWORD_STORE_CLIP_TIME The time remaining for which a password copied to the clipboard.
+ echo. PASSWORD_STORE_GPG_OPTS Additional options to be passed to all invocations of GPG.
+
+)
+
where gpg.exe >nul 2>nul
IF NOT %ERRORLEVEL% EQU 0 (
echo GPG isn't installed. Exiting...
@@ -26,28 +49,11 @@ IF NOT DEFINED PASSWORD_STORE_DIR (
)
IF [%~1] EQU [] (
- echo.Copyright ^(c^) 2012-2018, Jason A. Donenfeld ^<Jason@zx2c4.com^>
- echo.Copyright ^(c^) 2019-2021, Miquel Lionel
- echo.
- echo.Here's the available parameters for pass. Params between [] are MANDATORY:
- echo.
- echo. ls - without arguments, it list the entire password store as a tree.
- echo. show [passname] - decrypt the password with name [passname], output the result to the console
- echo. insert [passname] - insert a password with name [passname], prompt for input. Stop and save with a newline and by pressing Ctrl+Z on your keyboard.
- echo. rm [passname] - delete the password matching [passname]. Prompts for confirmation.
- echo. rmf [passname] - force the deletion of password matching [passname].
- echo. rmrf [passname] - recursively and forcefully delete a directory in the password store.
- echo. clip [passname] [linenumber] - copy into the clipboard the text at line [linenumber] for password matching [passname].
-
- echo.
- echo.ENVIRONNEMENT VARIABLES:
- echo. PASSWORD_STORE_KEY The key^(s^) ID in 0xlong form. Can alternatively be in a .gpg-id file in the password store directory, searches in it by default.
- echo. PASSWORD_STORE_DIR The directory which contains the password, with .gpg %GPG_OPTS% extension.
- echo. PASSWORD_STORE_CLIP_TIME The time remaining for which a password copied to the clipboard.
- echo. PASSWORD_STORE_GPG_OPTS Additional options to be passed to all invocations of GPG.
-
+ pass ls
+ goto :eof
)
+
IF ["%1"] EQU ["init"] (
shift
if [%~1] EQU [] (