fedora-rpmdevtools fedora-extract, 1.3, 1.4 fedora-diffarchive, 1.4, 1.5

Ville Skytta (scop) fedora-extras-commits at redhat.com
Mon Jun 5 18:26:00 UTC 2006


Author: scop

Update of /cvs/fedora/fedora-rpmdevtools
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11391

Modified Files:
	fedora-extract fedora-diffarchive 
Log Message:
Improve docs, make help2man friendly.


Index: fedora-extract
===================================================================
RCS file: /cvs/fedora/fedora-rpmdevtools/fedora-extract,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- fedora-extract	26 Feb 2006 15:53:55 -0000	1.3
+++ fedora-extract	5 Jun 2006 18:25:57 -0000	1.4
@@ -1,12 +1,21 @@
 #!/bin/bash
+# -*- coding: utf-8 -*-
 
+# fedora-extract -- Extract various archives in "tar xvf" style
 #
-# fedora-extract
-# Extract various archives, "tar xvf" style
+# 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; either version 2 of the License, or
+# (at your option) any later version.
 #
-# Author:  Ville Skyttä <ville.skytta at iki.fi>
-# License: GPL
-# $Id$
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 # TODO: more archive types
 
@@ -18,12 +27,46 @@
 force=
 dir=
 
+version()
+{
+    cat <<EOF
+fedora-extract version 1.0
+
+Copyright (c) 2004-2006 Fedora Project <http://fedoraproject.org/>.
+This  program is licensed under the GNU General Public License, see the
+file COPYING included in the distribution archive.
+
+Written by Ville Skyttä.
+EOF
+}
+
+help()
+{
+    cat <<EOF
+fedora-extract extracts various archives in "tar xvf" style.
+
+Depending on availability of external (un)archiver programs, the following
+archive types are supported: ace, ar/deb, arj, cab/exe, cpio, lha, rar, rpm,
+tar, zip/jar, zoo.
+
+EOF
+    usage
+    echo ""
+    echo "Report bugs to <http://bugzilla.redhat.com/>."
+}
+
 usage()
 {
-    echo "Usage: `basename $0` [-qf] [-C dir] ARCHIVE..."
-    echo "  -q        Suppress output."
-    echo "  -f        Force overwriting existing files."
-    echo "  -C dir    Change to directory 'dir' before extracting."
+    cat <<EOF
+Usage: fedora-extract [OPTION]... ARCHIVE...
+
+Options:
+  -q        Suppress output.
+  -f        Force overwriting existing files.
+  -C DIR    Change to directory DIR before extracting.
+  -h        Print help message and exit.
+  -v        Print version information and exit.
+EOF
 }
 
 fmime()
@@ -140,11 +183,13 @@
 
 dir="$PWD"
 
-while getopts "qfC:" key ; do
+while getopts "qfC:hv" key ; do
     case "$key" in
         q) quiet=1 ;;
         f) force=1 ;;
         C) dir="$OPTARG" ;;
+        h) help ; exit 0 ;;
+        v) version ; exit 0 ;;
         *) usage ; exit 1 ;;
     esac
 done


Index: fedora-diffarchive
===================================================================
RCS file: /cvs/fedora/fedora-rpmdevtools/fedora-diffarchive,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- fedora-diffarchive	26 Feb 2006 15:53:55 -0000	1.4
+++ fedora-diffarchive	5 Jun 2006 18:25:57 -0000	1.5
@@ -1,12 +1,21 @@
 #!/bin/bash
+# -*- coding: utf-8 -*-
 
+# fedora-diffarchive -- Diff contents of two archives
 #
-# fedora-diffarchive
-# Diff contents of two archives
+# 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; either version 2 of the License, or
+# (at your option) any later version.
 #
-# Author:  Ville Skyttä <ville.skytta at iki.fi>
-# License: GPL
-# $Id$
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 set -e
 
@@ -22,11 +31,40 @@
     [ -z "$tmpdir" -o ! -d "$tmpdir" ] || rm -rf "$tmpdir"
 }
 
+version()
+{
+    cat <<EOF
+fedora-diffarchive version 1.0
+
+Copyright (c) 2004-2006 Fedora Project <http://fedoraproject.org/>.
+This  program is licensed under the GNU General Public License, see the
+file COPYING included in the distribution archive.
+
+Written by Ville Skyttä.
+EOF
+}
+
+help()
+{
+    cat <<EOF
+fedora-diffarchive diffs contents of two archives.
+
+See fedora-extract(1) for information about supported archive types.
+EOF
+    usage
+    echo ""
+    echo "Report bugs to <http://bugzilla.redhat.com/>."
+}
+
 usage()
 {
     cat <<EOF
-Usage: `basename $0` [-l,--list] [diff-options] from-archive to-archive
+Usage: fedora-diffarchive [OPTION]... [DIFF_OPTIONS] FROM-ARCHIVE TO-ARCHIVE
+
+Options:
   -l, --list    Diff lists of files in archives, not files themselves.
+  -h, --help    Print help message and exit.
+  -v, --version Print version information and exit.
   diff-options  Options passed to diff(1), in addition to -r (default: -Nu).
                 The first argument not starting with a '-' ends diff-options.
 EOF
@@ -34,9 +72,11 @@
 
 while true ; do
     case "$1" in
-        -l|--list) [ -n "$list" ] && diffopts="$diffopts $1" || list=true ;;
-        -*)        diffopts="$diffopts $1" ;;
-        *)         break ;;
+        -l|--list)    [ -n "$list" ] && diffopts="$diffopts $1" || list=true ;;
+        -h|--help)    help ; exit 0 ;;
+        -v|--version) version ; exit 0 ;;
+        -*)           diffopts="$diffopts $1" ;;
+        *)            break ;;
     esac
     shift
 done




More information about the fedora-extras-commits mailing list