From 50f873816808d3958a563f00eb29adc821e16dc4 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Wed, 2 Jun 2021 14:41:58 +0100 Subject: implement the help function - also be moar like unix counterpart: without arguments it does `pass ls` --- pass.bat | 46 ++++++++++++++++++++++++++-------------------- 1 file 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 ^ + 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 ^ - 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 [] ( -- cgit v1.2.3-70-g09d2