Started work on bash-it help aliases
parent
5ff873e058
commit
4cda9c0a43
|
|
@ -471,7 +471,7 @@ _help-aliases()
|
|||
|
||||
_help-list-aliases ()
|
||||
{
|
||||
typeset file=$(basename $1)
|
||||
typeset file=$(basename $1 | sed -e 's/\(.*\)\..*\.bash/\1/g')
|
||||
printf '\n\n%s:\n' "${file%%.*}"
|
||||
# metafor() strips trailing quotes, restore them with sed..
|
||||
cat $1 | metafor alias | sed "s/$/'/"
|
||||
|
|
|
|||
|
|
@ -31,16 +31,36 @@ function local_setup {
|
|||
# TODO Create global __get_enabled_name function
|
||||
|
||||
@test "helpers: bash-it help aliases ag" {
|
||||
run bash-it help alias "ag"
|
||||
run bash-it help aliases "ag"
|
||||
assert_line "0" "ag='ag --smart-case --pager=\"less -MIRFX'"
|
||||
}
|
||||
|
||||
@test "helpers: bash-it help aliases without any aliases enabled" {
|
||||
run bash-it help alias
|
||||
echo "${lines[@]}"
|
||||
run bash-it help aliases
|
||||
assert_line "0" ""
|
||||
}
|
||||
|
||||
@test "helpers: bash-it help aliases one alias enabled in the old directory" {
|
||||
ln -s $BASH_IT/aliases/available/ag.aliases.bash $BASH_IT/aliases/enabled/150---ag.aliases.bash
|
||||
assert [ -L "$BASH_IT/aliases/enabled/150---ag.aliases.bash" ]
|
||||
|
||||
run bash-it help aliases
|
||||
|
||||
echo "${lines[@]}"
|
||||
assert_line "0" "ag:"
|
||||
}
|
||||
|
||||
@test "helpers: bash-it help aliases one alias enabled" {
|
||||
run bash-it enable alias "ag"
|
||||
assert_line "0" 'ag enabled with priority 150.'
|
||||
assert [ -L "$BASH_IT/enabled/150---ag.aliases.bash" ]
|
||||
|
||||
run bash-it help aliases
|
||||
|
||||
echo "${lines[@]}"
|
||||
assert_line "2" "foo"
|
||||
}
|
||||
|
||||
@test "helpers: enable the todo.txt-cli aliases through the bash-it function" {
|
||||
run bash-it enable alias "todo.txt-cli"
|
||||
assert_line "0" 'todo.txt-cli enabled with priority 150.'
|
||||
|
|
|
|||
Loading…
Reference in New Issue