]> git.nbdom.net Git - nb.git/commitdiff
default action
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 11 Jan 2023 10:42:19 +0000 (11:42 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 11 Jan 2023 10:42:19 +0000 (11:42 +0100)
etc/profile.d/functions
lib/php/db.php

index 84f86adc98ec0274b3ad73a7dfa777ef951a98cc..7f3dbc9b7ba27c16840708a19edab49d74e7fce5 100755 (executable)
@@ -130,15 +130,8 @@ nb_repos_ls() {
 }
 
 nb_repos_grep() {
-# NB 11.09.18  local count=0
-# NB 11.09.18  local lines=100
        nb_repos_ls_files | while read i; do
-# NB 11.09.18          count=$(($count+1))
-# NB 11.09.18          if [ $count -gt $lines ]; then
-# NB 11.09.18                  count=0
-# NB 11.09.18          fi
-# NB 11.09.18          echo "$count $i"
-               grep $@ "$i"
+               grep "$@" -HsI "$i"
        done
 }
 
index c1a7b921c3525d1ce6ded995a76eef3911c55f61..7eba7704f93d1f3cd97c3dbe1e025a12b0756b58 100644 (file)
@@ -644,7 +644,8 @@ class Db extends nb {
        public function action($action,$table=null) {
                #debug(($this->tables));
                # NB 09.12.22: Test is action is defined (eg: from lib/php/db/dbq.php) 
-               $actions = $action ? explode(',',$action) : [];
+               $actions = $action ? explode(',',$action) : [''];
+               # NB 11.01.23 need empty default action: $actions = $action ? explode(',',$action) : [];
 # NB 02.12.16     $this->pdef('format',($this->php_cli() ? 'csv' : ''));
                $rows = [];
                $return = false;