From: Nicolas Boisselier Date: Thu, 16 Jul 2026 16:14:26 +0000 (+0200) Subject: R bin/nb-php-grep-unique.sh -> bin/nb-php-grep-unique.sh.TODEL X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=59d7316806b71eeef21fc43c490da0f65a53a8e0;p=nb.git R bin/nb-php-grep-unique.sh -> bin/nb-php-grep-unique.sh.TODEL --- diff --git a/bin/nb-php-grep-unique.sh b/bin/nb-php-grep-unique.sh deleted file mode 100755 index 7c322115..00000000 --- a/bin/nb-php-grep-unique.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env bash -################################################################################# -# -# NB 12.12.22 - (C) 2022 Nicolas Boisselier -# Used to search unique capture pattern in php files -# -################################################################################# - -set -o errexit -declare -r NAME="$(basename "${0}")" -################################################################################ -# -# Default value options -# -################################################################################# -VERBOSE=0 -DEBUG=0 - -################################################################################ -# -# Functions -# -################################################################################# -usage() { -echo " -=head1 NAME - -${NAME} - -=head1 SYNOPSIS - -Example shell script with embedded POD documentation - - -v, --verbose Print verbose mode - -d, --debug Print debug messages - -h, --help Print this help (alternatives: --man, --help2man) - -=head1 DESCRIPTION - -Long description - -=head1 SEE ALSO - -http://blog.nbdom.net/ - -=head1 LICENSE - -Copyright (C) 2022 Nicolas Boisselier - -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 3 of the License, or (at your option) any later version. - -See . - -=head1 AUTHOR - -Nicolas Boisselier -" -} - -################################################################################# -# -# Args -# -################################################################################# -ARGS="" -ALL=0 -UNIQ=0 -while [ $# -gt 0 ]; do - - case "$1" in - - --all) ALL=1 ;; - --uniq) UNIQ=1 ;; - - -*help|-h) usage | pod2text --width 250; exit 0 ;; - --man) usage | pod2man | man -l -; exit 0 ;; - --help2man) usage | pod2man; exit 0 ;; - - --verbose|-v) VERBOSE=$(($VERBOSE+1)) ;; - - --debug|-d) DEBUG=$(($DEBUG+1)) ;; - - *) ARGS="$ARGS " - - esac - shift - -done - -################################################################################# -# -# Main -# -################################################################################# -cd "$(dirname "$0")"/.. - -[ "$ALL" = 1 ] && ARGS="$ARGS $(git ls-files | grep '\.php$')" - -EXP='(?:[:>]p(?:def)?\(["'"'"']([\w-]+))' -if [ "$UNIQ" = 1 ]; then - pcregrep -h -o1 "$EXP" $ARGS | sort | uniq -c -else - pcregrep -n -H -o1 "$EXP" $ARGS -fi diff --git a/bin/nb-php-grep-unique.sh.TODEL b/bin/nb-php-grep-unique.sh.TODEL new file mode 100755 index 00000000..7c322115 --- /dev/null +++ b/bin/nb-php-grep-unique.sh.TODEL @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +################################################################################# +# +# NB 12.12.22 - (C) 2022 Nicolas Boisselier +# Used to search unique capture pattern in php files +# +################################################################################# + +set -o errexit +declare -r NAME="$(basename "${0}")" +################################################################################ +# +# Default value options +# +################################################################################# +VERBOSE=0 +DEBUG=0 + +################################################################################ +# +# Functions +# +################################################################################# +usage() { +echo " +=head1 NAME + +${NAME} + +=head1 SYNOPSIS + +Example shell script with embedded POD documentation + + -v, --verbose Print verbose mode + -d, --debug Print debug messages + -h, --help Print this help (alternatives: --man, --help2man) + +=head1 DESCRIPTION + +Long description + +=head1 SEE ALSO + +http://blog.nbdom.net/ + +=head1 LICENSE + +Copyright (C) 2022 Nicolas Boisselier + +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 3 of the License, or (at your option) any later version. + +See . + +=head1 AUTHOR + +Nicolas Boisselier +" +} + +################################################################################# +# +# Args +# +################################################################################# +ARGS="" +ALL=0 +UNIQ=0 +while [ $# -gt 0 ]; do + + case "$1" in + + --all) ALL=1 ;; + --uniq) UNIQ=1 ;; + + -*help|-h) usage | pod2text --width 250; exit 0 ;; + --man) usage | pod2man | man -l -; exit 0 ;; + --help2man) usage | pod2man; exit 0 ;; + + --verbose|-v) VERBOSE=$(($VERBOSE+1)) ;; + + --debug|-d) DEBUG=$(($DEBUG+1)) ;; + + *) ARGS="$ARGS " + + esac + shift + +done + +################################################################################# +# +# Main +# +################################################################################# +cd "$(dirname "$0")"/.. + +[ "$ALL" = 1 ] && ARGS="$ARGS $(git ls-files | grep '\.php$')" + +EXP='(?:[:>]p(?:def)?\(["'"'"']([\w-]+))' +if [ "$UNIQ" = 1 ]; then + pcregrep -h -o1 "$EXP" $ARGS | sort | uniq -c +else + pcregrep -n -H -o1 "$EXP" $ARGS +fi