3 #=======================================================================
5 # File ID: 9aa77afc-3550-11e2-9816-00c0a8deee11
7 # Tree view of a subdirectory structure, optimised for git-annex.
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #=======================================================================
29 " -n "$progname" -- "$@
")"
30 test "$?" = "0" ||
exit 1
40 -C|
--colour) opt_colour
=1; shift ;;
41 -d|
--directories) opt_directories
=1; shift ;;
42 -h|
--help) opt_help
=1; shift ;;
43 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
44 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
45 --version) echo $progname $VERSION; exit 0 ;;
47 *) echo $progname: Internal error
>&2; exit 1 ;;
50 opt_verbose
=$
(($opt_verbose - $opt_quiet))
52 if test "$opt_help" = "1"; then
53 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
56 Tree view of a subdirectory structure, optimised for git-annex.
57 Arguments and options after " -- " are delivered to tree(1).
59 Usage: $progname [options] [ -- OPTIONS_TO_tree(1) ]
66 Only list directories.
70 Be more quiet. Can be repeated to increase silence.
72 Increase level of verbosity. Can be repeated.
74 Print version information.
80 if test "$opt_colour" = "1"; then
86 if test "$opt_directories" = "1"; then
92 tree
--charset UTF-8
$colour_str$directories_str -N "$@" |
93 perl
-pe 's/^(.*)( -> \.\..*)/$1/' |