Add doc function

This commit is contained in:
Bruno Tavares
2014-02-21 19:30:18 -03:00
parent 246ae7051e
commit 460fdd57f8
3 changed files with 38 additions and 6 deletions

12
lib/kickstart-doc Executable file
View File

@ -0,0 +1,12 @@
#!/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
}
[ -z "$1" ] && list || show $1