From ae520035f9f550c0bf80c60365a08b2fde6e4e9a Mon Sep 17 00:00:00 2001 From: amery Date: Mon, 2 Jul 2007 20:19:42 +0000 Subject: [PATCH] * added initial adtree program --- adtree | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 adtree diff --git a/adtree b/adtree new file mode 100755 index 0000000..fd9ddac --- /dev/null +++ b/adtree @@ -0,0 +1,64 @@ +#!/bin/sh +# Copyright (C) 2007 Alejandro Mery +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. + +version='0.0-trunk' +verbose= +progname=${0##*/} + +adtree_usage() { + cat <&1; } +adtree_warn() { echo -e "WARN: $@" 2>&1; } +adtree_error() { echo -e "ERROR: $@" 2>&1; } + +# analyse the given options +shortopts='?Vvq' +longopts='version,verbose,quiet' + +options=$( getopt -o "$shortopts" -l "$longopts" -- "$@" ) +if [ $? -ne 0 ]; then + adtree_usage + exit -1 +fi + +# load new arguments list +eval set -- "$options" + +while [ $# -gt 0 ]; do + case "$1" in + -V|--version) + cat <<-EOT + adtree $version + Copyright (C) 2007 Alejandro Mery + EOT + exit + ;; + -v|--verbose) + verbose=1 ;; + -q|--quiet) + verbose= ;; + --) + shift; break ;; + esac + shift +done + +# if not folder was given, use . +[ $# -gt 0 ] || set -- . + +for x; do + adtree_echo "--> '$x'" +done + -- 2.11.4.GIT