3 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
5 ## Use of this source code is governed by a BSD-style license
6 ## that can be found in the LICENSE file in the root of the source
7 ## tree. An additional intellectual property rights grant can be found
8 ## in the file PATENTS. All contributing project authors may
9 ## be found in the AUTHORS file in the root of the source tree.
18 echo "Usage: $self <example.txt>"
29 block_name=${line##*@}
30 indent=${line%%${block_name}}
32 [ $indent -eq 1 ] && indent=0
34 while IFS=$'\n' read -r t_line; do
37 if [ "x$on_block" == "xyes" ]; then
44 if [ "x$on_block" == "xyes" ]; then
45 include_block $show_bar < "${template%.c}.txt"
50 if [ "x$on_block" == "xyes" ]; then
52 (( rem = 78 - indent ))
54 \**) printf "%${indent}s * %s\n" "" "$t_line" ;;
56 if [ "$show_bar" == "yes" ]; then
57 printf "%${indent}s%-${rem}s//\n" "" "$t_line"
59 printf "%${indent}s%s\n" "" "$t_line"
70 [ -f "$txt" ] || die_usage
71 read -r template < "$txt"
73 @TEMPLATE*) template=${txt%/*}/${template##@TEMPLATE } ;;
74 *) die "Failed to parse template name from '$template'" ;;
77 while IFS=$'\n' read -r line; do
79 @*) include_block yes < "$txt" \
80 || include_block < "${template%.c}.txt" \
81 #|| echo "WARNING: failed to find text for block $block_name" >&2