manuals finished, new help based on man, zsh plugin

pull/10/head
sobolevn 8 years ago
parent 6278d2e597
commit bf6fdac0b2

@ -6,17 +6,13 @@
This project is still under development. Current objectives:
- add '-h|-?' to all commands
- add `trust-model` parameter to `git-secret-hide`
- add exception when running `git secret hide` with no files added
- manuals
- hooks: `pre-commit` to encrypt secret files
- static site for `gh-pages` build from manuals with `Jekyll` and `Ronn`
- plugin for `zsh`
- autocomplete for `zsh` plugin
- extra tests
- precompiled distributions for `brew` and other package managers
- create CONTRIBUTING.md with custom styleguide and development-hooks: manual auto-build
- refactor code due to styleguide
- create `CONTRIBUTING.md` with custom styleguide, refactor code due to styleguide
- сygwin support (?)

@ -0,0 +1,23 @@
# Copyright 2016 Sobolev Nikita <mail@sobolevn.me>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Create binary:
PLUGIN_DIR="$(dirname $0)"
if [ ! -f "$PLUGIN_DIR/git-secret" ]; then
cd "$PLUGIN_DIR" && make build && cd ..
fi
# Add our plugin's bin diretory to user's path
export PATH="${PATH}:${PLUGIN_DIR}"

@ -10,7 +10,7 @@
.
.nf
git secret add [<pathspec>\.\.\.]
git secret add <pathspec>\.\.\.
.
.fi
.
@ -23,5 +23,13 @@ If there\'s no users in the \fBgit\-secret\fR\'s keyring, when adding a file, an
.P
It is not recommened to add filenames directly into the \fB\.gitsecret/paths/mapping\.cfg\fR, use the command\.
.
.SH "OPTIONS"
.
.nf
\-h \- shows this help\.
.
.fi
.
.SH "SEE ALSO"
git\-secret\-init(1), git\-secret\-tell(1), git\-secret\-hide(1), git\-secret\-reveal(1)

@ -3,7 +3,7 @@ git-secret-add - starts to track added files.
## SYNOPSIS
git secret add [<pathspec>...]
git secret add <pathspec>...
## DESCRIPTION
@ -13,6 +13,12 @@ If there's no users in the `git-secret`'s keyring, when adding a file, an except
It is not recommened to add filenames directly into the `.gitsecret/paths/mapping.cfg`, use the command.
## OPTIONS
-h - shows this help.
## SEE ALSO
git-secret-init(1), git-secret-tell(1), git-secret-hide(1), git-secret-reveal(1)

@ -0,0 +1,30 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET\-CLEAN" "1" "February 2016" "" ""
.
.SH "NAME"
\fBgit\-secret\-clean\fR \- removes all the hidden files\.
.
.SH "SYNOPSIS"
.
.nf
git secret clean [\-v]
.
.fi
.
.SH "DESCRIPTION"
\fBgit\-secret\-clean\fR deletes all the encrypted files\. This command can produce a verbose output, printing which files are deleted\.
.
.SH "OPTIONS"
.
.nf
\-v \- shows which files are deleted\.
\-h \- shows this help\.
.
.fi
.
.SH "SEE ALSO"
git\-secret\-whoknows(1), git\-secret\-add(1), git\-secret\-remove(1), git\-secret\-hide(1), git\-secret\-reveal(1)

@ -0,0 +1,21 @@
git-secret-clean - removes all the hidden files.
================================================
## SYNOPSIS
git secret clean [-v]
## DESCRIPTION
`git-secret-clean` deletes all the encrypted files. This command can produce a verbose output, printing which files are deleted.
## OPTIONS
-v - shows which files are deleted.
-h - shows this help.
## SEE ALSO
git-secret-whoknows(1), git-secret-add(1), git-secret-remove(1), git-secret-hide(1), git-secret-reveal(1)

@ -17,5 +17,13 @@ git secret init
.SH "DESCRIPTION"
\fBgit\-secret\-init\fR should be runned inside a \fBgit\fR repo\. \fBgit\-secret\-init\fR is the first command to be runned, until the git\-secret repository is inited other commands are unavailable\.
.
.SH "OPTIONS"
.
.nf
\-h \- shows this help\.
.
.fi
.
.SH "SEE ALSO"
git\-init(1), git\-secret\-tell(1)

@ -10,6 +10,11 @@ git-secret-init - initializes git-secret repository.
`git-secret-init` should be runned inside a `git` repo. `git-secret-init` is the first command to be runned, until the git-secret repository is inited other commands are unavailable.
## OPTIONS
-h - shows this help.
## SEE ALSO
git-init(1), git-secret-tell(1)

@ -0,0 +1,29 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET\-KILLPERSON" "1" "February 2016" "" ""
.
.SH "NAME"
\fBgit\-secret\-killperson\fR \- deletes key identified by an email from the inner keyring\.
.
.SH "SYNOPSIS"
.
.nf
git secret killperson [email]
.
.fi
.
.SH "DESCRIPTION"
\fBgit\-secret\-killperson\fR makes it impossible for given user to decrypt the hidden file in the future\. It is required to run \fBgit\-secret\-hide\fR once again with the updated keyring\.
.
.SH "OPTIONS"
.
.nf
\-h \- shows this help\.
.
.fi
.
.SH "SEE ALSO"
git\-secret\-tell(1), git\-secret\-hide(1), git\-secret\-reveal(1)

@ -0,0 +1,20 @@
git-secret-killperson - deletes key identified by an email from the inner keyring.
==================================================================================
## SYNOPSIS
git secret killperson [email]
## DESCRIPTION
`git-secret-killperson` makes it impossible for given user to decrypt the hidden file in the future. It is required to run `git-secret-hide` once again with the updated keyring.
## OPTIONS
-h - shows this help.
## SEE ALSO
git-secret-tell(1), git-secret-hide(1), git-secret-reveal(1)

@ -0,0 +1,29 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET\-LIST" "1" "February 2016" "" ""
.
.SH "NAME"
\fBgit\-secret\-list\fR \- prints all the added files\.
.
.SH "SYNOPSIS"
.
.nf
git secret list
.
.fi
.
.SH "DESCRIPTION"
\fBgit\-secret\-list\fR prints all the currently added tracked files from the \fB\.gitsecret/paths/mapping\.cfg\fR\.
.
.SH "OPTIONS"
.
.nf
\-h \- shows this help\.
.
.fi
.
.SH "SEE ALSO"
git\-secret\-whoknows(1), git\-secret\-add(1), git\-secret\-remove(1), git\-secret\-hide(1), git\-secret\-reveal(1)

@ -0,0 +1,20 @@
git-secret-list - prints all the added files.
=============================================
## SYNOPSIS
git secret list
## DESCRIPTION
`git-secret-list` prints all the currently added tracked files from the `.gitsecret/paths/mapping.cfg`.
## OPTIONS
-h - shows this help.
## SEE ALSO
git-secret-whoknows(1), git-secret-add(1), git-secret-remove(1), git-secret-hide(1), git-secret-reveal(1)

@ -0,0 +1,29 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET\-USAGE" "1" "February 2016" "" ""
.
.SH "NAME"
\fBgit\-secret\-usage\fR \- prints all the available commands\.
.
.SH "SYNOPSIS"
.
.nf
git secret usage
.
.fi
.
.SH "DESCRIPTION"
\fBgit\-secret\-usage\fR is used to print all the available commands\.
.
.SH "OPTIONS"
.
.nf
\-h \- shows this help\.
.
.fi
.
.SH "SEE ALSO"
git\-secret\-init(1), git\-secret\-add(1), git\-secret\-hide(1), git\-secret\-reveal(1)

@ -0,0 +1,20 @@
git-secret-usage - prints all the available commands.
=====================================================
## SYNOPSIS
git secret usage
## DESCRIPTION
`git-secret-usage` is used to print all the available commands.
## OPTIONS
-h - shows this help.
## SEE ALSO
git-secret-init(1), git-secret-add(1), git-secret-hide(1), git-secret-reveal(1)

@ -0,0 +1,29 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET\-WHOKNOWS" "1" "February 2016" "" ""
.
.SH "NAME"
\fBgit\-secret\-whoknows\fR \- prints email\-labels for each key in the keyring\.
.
.SH "SYNOPSIS"
.
.nf
git secret whoknows
.
.fi
.
.SH "DESCRIPTION"
\fBgit\-secret\-whokowns\fR prints list of email addresses which are used as labels for currently public keys added to the local keyring\.
.
.SH "OPTIONS"
.
.nf
\-h \- shows this help\.
.
.fi
.
.SH "SEE ALSO"
git\-secret\-list(1), git\-secret\-add(1), git\-secret\-hide(1), git\-secret\-reveal(1)

@ -0,0 +1,20 @@
git-secret-whoknows - prints email-labels for each key in the keyring.
======================================================================
## SYNOPSIS
git secret whoknows
## DESCRIPTION
`git-secret-whokowns` prints list of email addresses which are used as labels for currently public keys added to the local keyring.
## OPTIONS
-h - shows this help.
## SEE ALSO
git-secret-list(1), git-secret-add(1), git-secret-hide(1), git-secret-reveal(1)

@ -112,6 +112,14 @@ function _unique_filename {
}
# Manuals:
function _show_manual_for {
local function_name="$1"
man git-secret-$function_name
exit 0
}
# VCS :
function _check_ignore {

@ -2,6 +2,14 @@
function add {
OPTIND=1
while getopts "h" opt; do
case "$opt" in
h) _show_manaul_for "add";;
esac
done
_user_required
local not_ignored=()

@ -1,43 +1,24 @@
#!/usr/bin/env bash
function _show_help_clean {
cat <<-EOF
usage: git secret clean [-v]
removes all the hidden files.
options:
-v shows which files are deleted.
-h shows this help.
EOF
exit 0
}
function clean {
OPTIND=1
local verbose=""
while getopts "vh" opt; do
case "$opt" in
v)
verbose="v"
;;
v) verbose="v";;
h)
_show_help_clean
;;
h) _show_manual_for "clean";;
esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift
[[ ! -z $verbose ]] && echo && echo "cleaing:" || : # bug with custom bash on OSX
[[ ! -z "$verbose" ]] && echo && echo "cleaing:" || : # bug with custom bash on OSX
find . -name *$SECRETS_EXTENSION -type f | xargs rm -f$verbose
[[ ! -z $verbose ]] && echo || : # bug with custom bash on OSX
[[ ! -z "$verbose" ]] && echo || : # bug with custom bash on OSX
}

@ -1,21 +1,6 @@
#!/usr/bin/env bash
function _show_help_hide {
cat <<-EOF
usage: git secret hide [-c] [-v]
encrypts all the files added by the 'add' command.
options:
-c deletes encrypted files before creating new ones.
-v shows which files are deleted.
-h shows this help.
EOF
exit 0
}
function _optional_clean {
OPTIND=1
local clean=0
@ -25,7 +10,7 @@ function _optional_clean {
case "$opt" in
c) clean=1;;
h) _show_help_hide;;
h) _show_manual_for "hide";;
v) opt_string="-v";;
esac

@ -2,6 +2,13 @@
function init {
OPTIND=1
while getopts "h" opt; do
case "$opt" in
h) _show_manual_for "init";;
esac
done
if [[ -d "$SECRETS_DIR" ]]; then
_abort "already inited."

@ -2,6 +2,14 @@
function killperson {
OPTIND=1
while getopts "h" opt; do
case "$opt" in
h) _show_manual_for "killperson";;
esac
done
_user_required
if [[ ${#@} -eq 0 ]]; then

@ -2,6 +2,14 @@
function list {
OPTIND=1
while getopts "h?" opt; do
case "$opt" in
h) _show_manual_for "list";;
esac
done
_user_required
if [[ ! -s "$SECRETS_DIR_PATHS_MAPPING" ]]; then

@ -1,20 +1,6 @@
#!/usr/bin/env bash
function _show_help_remove {
cat <<-EOF
usage: git secret remove [-c] <pathspec..>
removes files from git-secret's index."
options:
-c deletes existing real encrypted files.
-h shows this help.
EOF
exit 0
}
function remove {
OPTIND=1
local clean=0
@ -23,7 +9,7 @@ function remove {
case "$opt" in
c) clean=1;;
h) _show_help_remove;;
h) _show_manual_for "remove";;
esac
done

@ -1,21 +1,6 @@
#!/usr/bin/env bash
function _show_help_reveal {
cat <<-EOF
usage: git secret reveal [-d dir] [-p password]
unencrypts all the files added by the 'add' command.
options:
-d specifies --homedir option for gpg.
-p specifies password for noinput mode, adds --passphrase option for gpg.
-h shows this help.
EOF
exit 0
}
function reveal {
OPTIND=1
@ -24,7 +9,7 @@ function reveal {
while getopts "hd:p:" opt; do
case "$opt" in
h) _show_help_reveal;;
h) _show_manual_for "reveal";;
p) passphrase=$OPTARG;;

@ -1,21 +1,6 @@
#!/usr/bin/env bash
function _show_help_tell {
cat <<-EOF
usage: git secret tell [-m] [-d dir] [email]
adds a person, who can access the private data.
options:
-m - takes your current 'git config user.email' as an identifier for the key.
-d - specifies '--homedir' option for the 'gpg'
-h shows this help.
EOF
exit 0
}
function tell {
_secrets_dir_exists
@ -28,7 +13,7 @@ function tell {
while getopts "h?md:" opt; do
case "$opt" in
h) _show_help_tell;;
h) _show_manual_for "tell";;
m) # Set email of the git current user:
email=$(git config user.email) || _abort "'git congig user.email' is not set."

@ -1,7 +1,28 @@
#!/usr/bin/env bash
function _show_help_usage {
cat <<-EOF
usage: git secret usage
prints all the available commands.
options:
-h shows this help.
EOF
exit 0
}
function usage {
OPTIND=1
while getopts "h?" opt; do
case "$opt" in
h) _show_manual_for "usage";;
esac
done
local commands=""
local separator="|"

@ -2,6 +2,14 @@
function whoknows {
OPTIND=1
while getopts "h?" opt; do
case "$opt" in
h) _show_manual_for "whoknows";;
esac
done
_user_required
local keys=$(_get_users_in_keyring)

Loading…
Cancel
Save