alias-help()

pull/139/head
Erich Smith 2012-05-21 23:55:31 -04:00 committed by Nils Winkler
parent 17aaa9ce24
commit 961c914e0f
1 changed files with 41 additions and 20 deletions

View File

@ -55,7 +55,7 @@ bash-it-plugins ()
_bash-it-describe () _bash-it-describe ()
{ {
cite _about _param _example cite _about _param _example
_about 'summarizes available bash_it components' _about 'summarizes available bash_it components'
_param '1: subdirectory' _param '1: subdirectory'
_param '2: preposition' _param '2: preposition'
@ -118,16 +118,16 @@ disable-completion ()
_disable-thing () _disable-thing ()
{ {
cite _about _param _example cite _about _param _example
_about 'disables a bash_it component' _about 'disables a bash_it component'
_param '1: subdirectory' _param '1: subdirectory'
_param '2: file_type' _param '2: file_type'
_param '3: file_entity' _param '3: file_entity'
_example '$ _disable-thing "plugins" "plugin" "ssh"' _example '$ _disable-thing "plugins" "plugin" "ssh"'
subdirectory="$1" subdirectory="$1"
file_type="$2" file_type="$2"
file_entity="$3" file_entity="$3"
if [ -z "$file_entity" ]; then if [ -z "$file_entity" ]; then
reference "disable-$file_type" reference "disable-$file_type"
@ -187,16 +187,16 @@ enable-completion ()
_enable-thing () _enable-thing ()
{ {
cite _about _param _example cite _about _param _example
_about 'enables a bash_it component' _about 'enables a bash_it component'
_param '1: subdirectory' _param '1: subdirectory'
_param '2: file_type' _param '2: file_type'
_param '3: file_entity' _param '3: file_entity'
_example '$ _enable-thing "plugins" "plugin" "ssh"' _example '$ _enable-thing "plugins" "plugin" "ssh"'
subdirectory="$1" subdirectory="$1"
file_type="$2" file_type="$2"
file_entity="$3" file_entity="$3"
if [ -z "$file_entity" ]; then if [ -z "$file_entity" ]; then
reference "enable-$file_type" reference "enable-$file_type"
@ -231,6 +231,27 @@ _enable-thing ()
printf '%s\n' "$file_entity enabled." printf '%s\n' "$file_entity enabled."
} }
alias-help ()
{
about 'shows help for all aliases, or a specific alias group'
param '1: optional alias group'
example '$ alias-help'
example '$ alias-help git'
if [ -n "$1" ]; then
cat $BASH_IT/aliases/enabled/$1.aliases.bash | metafor alias | sed "s/$/'/"
else
typeset f
for f in $BASH_IT/aliases/enabled/*
do
typeset file=$(basename $f)
printf '\n\n%s:\n' "${file%%.*}"
# metafor() strips trailing quotes, restore them with sed..
cat $f | metafor alias | sed "s/$/'/"
done
fi
}
plugins-help () plugins-help ()
{ {
about 'summarize all functions defined by enabled bash-it plugins' about 'summarize all functions defined by enabled bash-it plugins'