# HG changeset patch # User Franz Glasner # Date 1565939787 -7200 # Node ID 124faa20ae800bd655d1f0e3a32444a78ab68f15 # Parent f5cf08e8d2467a5cb44ddc8734224c2d6b0d148c Implemented a "-V" global option to print the program's name and version number to stdout diff -r f5cf08e8d246 -r 124faa20ae80 Makefile --- a/Makefile Thu Aug 15 23:26:39 2019 +0200 +++ b/Makefile Fri Aug 16 09:16:27 2019 +0200 @@ -40,6 +40,7 @@ ${SED} -i "" -e "s|\\\$$Header\\\$$|\$$Header: ${_rp} ${HGREVISION} ${HGDATE} ${HGAUTHOR} ${HGPHASE} \$$|" ${WRKSRC}/${_rp} ${SED} -i "" -e "s|\\\$$HGid\\\$$|\$$HGid: ${HGPATH}/${_rp} ${HGREVISION} ${HGDATE} ${HGAUTHOR} ${HGPHASE} \$$|" ${WRKSRC}/${_rp} ${SED} -i "" -e "s|@@VERSION@@|${PORTVERSION}|" ${WRKSRC}/${_rp} + ${SED} -i "" -e "s|@@HGREVISION@@|${HGREVISION}|" ${WRKSRC}/${_rp} ${SED} -i "" -e "s|@@ETCDIR@@|${ETCDIR}|" ${WRKSRC}/${_rp} ${SED} -i "" -e "s|@@INDEXFILE@@|${INDEXFILE}|" ${WRKSRC}/${_rp} .endfor diff -r f5cf08e8d246 -r 124faa20ae80 bin/check-ports --- a/bin/check-ports Thu Aug 15 23:26:39 2019 +0200 +++ b/bin/check-ports Fri Aug 16 09:16:27 2019 +0200 @@ -203,8 +203,12 @@ short_flag="" verbose_flag="" -while getopts "Aasv" _opt ; do +while getopts "VAasv" _opt ; do case ${_opt} in + V) + echo "check-ports v${VERSION} (rv:@@HGREVISION@@)" + exit 0 + ;; A) # print for every package the status of all repositories alldata_flag=1 diff -r f5cf08e8d246 -r 124faa20ae80 bin/fjail --- a/bin/fjail Thu Aug 15 23:26:39 2019 +0200 +++ b/bin/fjail Fri Aug 16 09:16:27 2019 +0200 @@ -11,6 +11,8 @@ OPTIONS: + -V Print the program name and version number to stdout and exit + -h Print this help message to stdout and exit COMMANDS: @@ -230,8 +232,12 @@ # # Global option handling # -while getopts "h" _opt ; do +while getopts "Vh" _opt ; do case ${_opt} in + V) + echo "fjail v${VERSION} (rv:@@HGREVISION@@)" + exit 0 + ;; h) echo "${USAGE}" exit 0