Split sed script to only format help comments

This commit is contained in:
Julian Calaby 2015-07-23 09:39:41 +10:00
parent d229161326
commit 103182ad40

2
bocker
View File

@ -71,7 +71,7 @@ btrfs subvolume snapshot "$btrfs_path/$1" "$btrfs_path/$2" > /dev/null
echo "Created: $2"
}
function HELP() {
sed -n "s/\\\\n/\n\t/g;s/BOCKER/${1/\//\\\/}/g;s/$/\n/;s/^.*#HELP\\s//p;" < $1
sed -n "s/^.*#HELP\\s//p;" < $1 | sed "s/\\\\n/\n\t/g;s/BOCKER/${1/\//\\\/}/g;s/$/\n/;"
}
[[ -z "${1-}" ]] && HELP $0 && exit 0
case $1 in