3 ## Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
5 ## Use of this source code is governed by a BSD-style license and patent
6 ## grant that can be found in the LICENSE file in the root of the source
7 ## tree. All contributing project authors may be found in the AUTHORS
8 ## file in the root of the source tree.
17 echo "Usage: $self <example.txt>"
28 block_name
=${line##*@}
29 indent
=${line%%${block_name}}
31 [ $indent -eq 1 ] && indent
=0
33 while IFS
=$
'\n' read -r t_line
; do
36 if [ "x$on_block" == "xyes" ]; then
43 if [ "x$on_block" == "xyes" ]; then
44 include_block
$show_bar < "${template%.c}.txt"
49 if [ "x$on_block" == "xyes" ]; then
51 (( rem
= 78 - indent
))
53 \
**) printf "%${indent}s * %s\n" "" "$t_line" ;;
55 if [ "$show_bar" == "yes" ]; then
56 printf "%${indent}s%-${rem}s//\n" "" "$t_line"
58 printf "%${indent}s%s\n" "" "$t_line"
69 [ -f "$txt" ] || die_usage
70 read -r template
< "$txt"
72 @TEMPLATE
*) template
=${txt%/*}/${template##@TEMPLATE } ;;
73 *) die
"Failed to parse template name from '$template'" ;;
76 while IFS
=$
'\n' read -r line
; do
78 @
*) include_block
yes < "$txt" \
79 || include_block
< "${template%.c}.txt" \
80 #|| echo "WARNING: failed to find text for block $block_name" >&2