]> git.nbdom.net Git - nb.git/commitdiff
R bin/nb-php-grep-unique.sh -> bin/nb-php-grep-unique.sh.TODEL
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 16 Jul 2026 16:14:26 +0000 (18:14 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 16 Jul 2026 16:14:26 +0000 (18:14 +0200)
bin/nb-php-grep-unique.sh [deleted file]
bin/nb-php-grep-unique.sh.TODEL [new file with mode: 0755]

diff --git a/bin/nb-php-grep-unique.sh b/bin/nb-php-grep-unique.sh
deleted file mode 100755 (executable)
index 7c32211..0000000
+++ /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 <http://www.gnu.org/licenses/>.
-
-=head1 AUTHOR
-
-Nicolas Boisselier <nico@nbdom.net>
-"
-}
-
-#################################################################################
-#
-# 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 (executable)
index 0000000..7c32211
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+
+=head1 AUTHOR
+
+Nicolas Boisselier <nico@nbdom.net>
+"
+}
+
+#################################################################################
+#
+# 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