kickstart/lib/kickstart-doc
2015-05-20 17:16:16 -03:00

17 lines
289 B
Bash
Executable File

#!/bin/bash
list() {
root_dir=$(kickstart root-dir)
find "$root_dir"/docs -type f | sed -e 's/.md$//' | cut -c "$(wc -c <<<$root_dir/docs/)"- | tr '/' '.'
}
show() {
cat "$(kickstart root-dir)"/docs/"$(echo "$1" | tr '.' '/')".md
}
if [ -z "$1" ]; then
list
else
show "$1"
fi