[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
update-copyright ‘--help’ and ‘--version’
From: |
Thien-Thi Nguyen |
Subject: |
update-copyright ‘--help’ and ‘--version’ |
Date: |
Sun, 22 May 2016 13:35:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
For anyone interested, here is a small update-copyright wrapper
that supports ‘--help’ and ‘--version’:
#!/bin/sh
actual=$HOME/build/GNU/gnulib/build-aux/update-copyright
if [ x"$1" = x--help ] ; then
printf 'Usage: %s FILE...\n\n' `basename $0`
sed -e '/arguments to this script/,/^$/!d' \
-e 's/^#//' \
-e 's/^ //' \
$actual
exit 0
fi
if [ x"$1" = x--version ] ; then
sed '/^my .VERSION/!d' $actual
exit 0
fi
exec $actual "$@"
# update-copyright ends here
Originally i looked into modifying update-copyright directly, but
was defeated by Perl's ‘-i’ support (which, IIUC, says to take all
script args as filenames, hence leaving no room for the script to
check/handle args specially). Any hints on a Perl-only solution
greatly appreciated!
--
Thien-Thi Nguyen -----------------------------------------------
(if you're human and you know it) read my lisp:
(defun responsep (type via)
(case type
(technical (eq 'mailing-list via))
...))
---------------------------------------------- GPG key: 4C807502
signature.asc
Description: PGP signature
- update-copyright ‘--help’ and ‘--version’,
Thien-Thi Nguyen <=