From: Nicolas Boisselier Date: Sun, 11 Dec 2022 01:12:52 +0000 (+0100) Subject: etc/vim/source/functions.vim X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=1fb62343dd0abd9d7a4a6fb3de977aa717d44755;p=nb.git etc/vim/source/functions.vim --- diff --git a/bin/shell-replace b/bin/shell-replace index 28c2db0e..f16a5bab 100755 --- a/bin/shell-replace +++ b/bin/shell-replace @@ -33,6 +33,7 @@ my %Opt = ( get_options(\%Opt); #help() unless @ARGV; $main::_DATA_ = undef; +$Opt{find} = 1 if $Opt{'find-only'}; ################################################################################# # @@ -47,6 +48,7 @@ no warnings 'File::Find'; #$_ = "nb_api '/pub/mime/ls/type,ext.php_hash' | sed \"s/^/\$(printf '\\t\\t')/\""; #$_ = "nb_api /pub/mime/ls/type,ext.php_hash"; +#die map {">$_"} &cmd($_); #warn &cmd($_); @ARGV = grep {&file_readable($_)} @ARGV if @ARGV; if (!@ARGV and !-t STDIN) { @@ -68,6 +70,7 @@ if ($Opt{find}) { }, @ARGV); #exit; @ARGV = @WANTED_FILES; + exit if $Opt{'find-only'}; } # @@ -225,6 +228,7 @@ sub shell_replace { if ($i==1) { $cmd = $2; push @lines, $line; + #die $cmd; push @lines, map{s/^/$blank/;$_} &cmd($cmd); } elsif ($line =~ /^\s*.{1,3}' \,'xml' : '' \} diff --git a/lib/php/http.php b/lib/php/http.php index e1f85b1d..911d9798 100644 --- a/lib/php/http.php +++ b/lib/php/http.php @@ -1,7 +1,7 @@ SHELL_REPLACE dbq db=$NB_DB t=http_status rows.fields=id,name orderby=id f=php_hash | sed "s/^/\t/" +#>SHELL_REPLACE dbq.php /$NB_DB/http_status/ls/id,name orderby=id format=php_hash preff=$'\t' "100" => "Continue", "101" => "Switching Protocols", "102" => "Processing", diff --git a/lib/php/mime.php b/lib/php/mime.php index 4281854b..549a565a 100644 --- a/lib/php/mime.php +++ b/lib/php/mime.php @@ -1,7 +1,7 @@ SHELL_REPLACE nb_api '/pub/mime/ls/type,ext.php_hash' | sed "s/^/$(printf '\t\t')/" +#>SHELL_REPLACE nb_api "/pub/mime/ls/type,ext.php_hash?preff=%09%09" "application/applixware" => "aw", "application/atomcat+xml" => "atomcat", "application/atomsvc+xml" => "atomsvc", diff --git a/share/db/nb.db b/share/db/nb.db index fabf51c7..a0526b58 100644 Binary files a/share/db/nb.db and b/share/db/nb.db differ