commit 123a816aa17463988c204624102cfc6190b80e33 from: Alexander Arch via: Alex Arx date: Fri Nov 15 13:50:00 2024 UTC add options flags for the copy subcommand commit - 8aa96b43fa4adc65a0006064c5bb8461230446b1 commit + 123a816aa17463988c204624102cfc6190b80e33 blob - 8dd7d70bdc2be39134cab8ec3601d08b7e4f1e8f blob + f880dec098ceb952507c7e84e72e10187f7e3478 --- gpm +++ gpm @@ -16,14 +16,14 @@ my $gpg; # usage: print usage information to stderr and exit with error. sub usage { - my $cmd = basename $0; die -"usage: $cmd [-g command] [-d dir] add [-m] name\n" . -" $cmd [-g command] [-d dir] copy\n" . -" $cmd [-d dir] rm name ...\n" . -" $cmd [-g command] [-d dir] show name\n" . -" $cmd [-d dir] mv from to\n" . -" $cmd [-d dir] ls\n"; +"usage: gpm [-g command] [-d dir] add [-m] name\n" . +" gpm [-g command] [-d dir] copy [-d delcmd] [-i incmd] [-o outcmd]\n" . +" [-s time]\n" . +" gpm [-d dir] rm name ...\n" . +" gpm [-g command] [-d dir] show name\n" . +" gpm [-d dir] mv from to\n" . +" gpm [-d dir] ls\n"; } # getrecipient: return string to be used with gpg's -r option. @@ -191,13 +191,18 @@ sub show { # copy: decrypt file, and copy to GPM_COPY_INCMD, delete with GPM_COPY_DELCMD # after GPM_COPY_SLEEP seconds if necessary. sub copy { - my $incmd = $ENV{GPM_COPY_INCMD} // "xclip"; - my $outcmd = $ENV{GPM_COPY_SHOWCMD} // "xclip -o"; - my $delcmd = $ENV{GPM_COPY_DELCMD} // "xclip = 0 or usage(); + my $delcmd = $opt_d // $ENV{GPM_COPY_DELCMD} // "xclip