mirror of https://github.com/sobolevn/git-secret
add git secret cat filename [filename2] feature.
ronn file for manpage cleanup. Remove -f option. bump version to 0.2.4 remove unused variable add references to git secret cat in ronn docs. git-secret-cat man pagepull/142/head
parent
c5ed5579f4
commit
612e34cce8
@ -0,0 +1,34 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GIT\-SECRET\-CAT" "1" "April 2018" "sobolevn" "git-secret"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBgit\-secret\-cat\fR \- decrypts files passed on command line to stdout
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
.
|
||||
.nf
|
||||
|
||||
git secret cat [\-d dir] [\-p password] filename [filenames]
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
\fBgit\-secret\-cat\fR \- Outputs to stdout the contents of the files named on the command line by running a \fBgpg \-\-decrypt\fR command\. As with \fBgit\-secret\-reveal\fR, it is important to have paired secret\-key with one of the public\-keys, which were used in the encryption\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.nf
|
||||
|
||||
\-d \- specifies `\-\-homedir` option for the `gpg`, basically use this option if your store your keys in a custom location\.
|
||||
\-p \- specifies password for noinput mode, adds `\-\-passphrase` option for `gpg`\.
|
||||
\-h \- shows help\.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.SH "MANUAL"
|
||||
Run \fBman git\-secret\-cat\fR to see this note\.
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
git\-secret\-init(1) \fIhttp://git\-secret\.io/git\-secret\-init\fR, git\-secret\-tell(1) \fIhttp://git\-secret\.io/git\-secret\-tell\fR, git\-secret\-add(1) \fIhttp://git\-secret\.io/git\-secret\-add\fR, git\-secret\-hide(1) \fIhttp://git\-secret\.io/git\-secret\-hide\fR, git\-secret\-reveal(1) \fIhttp://git\-secret\.io/git\-secret\-cat\fR
|
@ -0,0 +1,27 @@
|
||||
git-secret-cat - decrypts files passed on command line to stdout
|
||||
=============================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
git secret cat [-d dir] [-p password] filename [filenames]
|
||||
|
||||
|
||||
## DESCRIPTION
|
||||
`git-secret-cat` - Outputs to stdout the contents of the files named on the command line by running a `gpg --decrypt` command. As with `git-secret-reveal`, it is important to have paired secret-key with one of the public-keys, which were used in the encryption.
|
||||
|
||||
|
||||
## OPTIONS
|
||||
|
||||
-d - specifies `--homedir` option for the `gpg`, basically use this option if your store your keys in a custom location.
|
||||
-p - specifies password for noinput mode, adds `--passphrase` option for `gpg`.
|
||||
-h - shows help.
|
||||
|
||||
|
||||
## MANUAL
|
||||
|
||||
Run `man git-secret-cat` to see this note.
|
||||
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
[git-secret-init(1)](http://git-secret.io/git-secret-init), [git-secret-tell(1)](http://git-secret.io/git-secret-tell), [git-secret-add(1)](http://git-secret.io/git-secret-add), [git-secret-hide(1)](http://git-secret.io/git-secret-hide), [git-secret-reveal(1)](http://git-secret.io/git-secret-cat)
|
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
function cat {
|
||||
local homedir=''
|
||||
local passphrase=''
|
||||
|
||||
OPTIND=1
|
||||
|
||||
while getopts 'hfd:p:' opt; do
|
||||
case "$opt" in
|
||||
h) _show_manual_for 'cat';;
|
||||
|
||||
p) passphrase=$OPTARG;;
|
||||
|
||||
d) homedir=$OPTARG;;
|
||||
|
||||
*) _invalid_option_for 'cat';;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
[ "$1" = '--' ] && shift
|
||||
|
||||
_user_required
|
||||
|
||||
# Command logic:
|
||||
|
||||
#local path_mappings
|
||||
#path_mappings=$(_get_secrets_dir_paths_mapping)
|
||||
|
||||
for line in "$@"
|
||||
do
|
||||
local filename
|
||||
local path
|
||||
#echo $line
|
||||
filename=$(_get_record_filename "$line")
|
||||
path=$(_append_root_path "$filename")
|
||||
|
||||
# The parameters are: filename, write-to-file, force, homedir, passphrase
|
||||
_decrypt "$path" "0" "0" "$homedir" "$passphrase"
|
||||
done
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# shellcheck disable=2034
|
||||
GITSECRET_VERSION='0.2.3'
|
||||
GITSECRET_VERSION='0.2.4'
|
||||
|
Loading…
Reference in New Issue