From 76e7f699f3db57369b565e400fff40b95cc1db9b Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 30 Jun 2011 19:05:01 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20comments=20to=20default=20bundle=20?= =?UTF-8?q?commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CopySingleLineQuoted.spBundle/command.plist | 29 +++++++++++++++++++++- .../WrapInDelimiter.spBundle/command.plist | 9 ++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist b/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist index 56cdd9c4..8983a3ae 100644 --- a/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist +++ b/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist @@ -7,7 +7,34 @@ category Query Editor command - cat | perl -ne 'chomp;s/\t/ /g;s/"/\\"/g;print "\"".$_."\" . \"\\n\" .\n"' | sed '$ s/.........$//' | sed '$ s/$/;/' | __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbcopy + # read STDIN which contains the string data coming from the Query Editor +# and pipe it to the following perl script +cat | perl -ne ' + +# delete final line ending +chomp; + +# substitute TABs by SPACEs +s/\t/ /g; + +# escape " +s/"/\\"/g; + +# output text and pipe it to sed +print "\"".$_."\" . \"\\n\" .\n"' | + +# delete last ‘"\n" .’ (the 9 last characters) +sed '$ s/.........$//' | + +# append ; +sed '$ s/$/;/' | + +# pipe the result to the UNIX command pbcopy which pastes +# the result into the clipboard; +# __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 tells pbcopy +# that the string is UTF-8 encoded +__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbcopy + contact znvy@ovovxb.qr description diff --git a/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist b/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist index 3588396e..b3eb463b 100644 --- a/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist +++ b/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist @@ -7,8 +7,15 @@ category Query Editor command - echo "DELIMITER \${0:;;}" + # write DELIMITER plus ;; as suggestion selected as snippet +echo "DELIMITER \${0:;;}" + +# `cat` reads the STDIN which contains the selected +# text from the Query Editor and write it as selected +# snippet plus the mirrowed suggested delimiter echo "\${1:`cat`}\${1:\$0}" + +# write DELIMITER plus ; echo "DELIMITER ;" contact znvy@ovovxb.qr -- cgit v1.2.3