diff sed.xml @ 4:56e80527c482 draft

Uploaded
author bgruening
date Wed, 07 Jan 2015 11:10:52 -0500
parents 7068d1548234
children 8928e6d1e7ba
line wrap: on
line diff
--- a/sed.xml	Sun Oct 06 08:22:36 2013 -0400
+++ b/sed.xml	Wed Jan 07 11:10:52 2015 -0500
@@ -1,19 +1,27 @@
-<tool id="tp_sed_tool" name="Text transformation" version="0.1.1">
-  <description>with sed</description>
-    <requirements>
+<tool id="tp_sed_tool" name="Text transformation" version="@BASE_VERSION@.0">
+    <description>with sed</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements">
         <requirement type="package" version="4.2.2-sandbox">gnu_sed</requirement>
-    </requirements>
+    </expand>
+    <version_command>sed --version | head -n 1</version_command>
     <command>
-        sed --sandbox -r 
-        
-        #if $adv_opts.adv_opts_selector == 'advanced':
-            $adv_opts.silent
-        #end if
-        -f '$sed_script' '$input' &gt; '$output'
+<![CDATA[
+        sed 
+            --sandbox
+            -r
+            #if $adv_opts.adv_opts_selector == 'advanced':
+                $adv_opts.silent
+            #end if
+            -f '$sed_script'
+            '$infile'
+        > '$output'
+]]>
     </command>
     <inputs>
-        <param format="txt" name="input" type="data" label="File to process" />
-
+        <param format="txt" name="infile" type="data" label="File to process" />
         <param name="url_paste" type="text" area="true" size="5x35" label="SED Program" help="">
             <sanitizer>
                 <valid initial="string.printable">
@@ -21,7 +29,6 @@
                 </valid>
             </sanitizer>
         </param>
-
         <conditional name="adv_opts">
             <param name="adv_opts_selector" type="select" label="Advanced Options">
               <option value="basic" selected="True">Hide Advanced Options</option>
@@ -35,32 +42,31 @@
                 </param>
             </when>
         </conditional>
-
-  </inputs>
+    </inputs>
     <configfiles>
-      <configfile name="sed_script">
+        <configfile name="sed_script">
           $url_paste
-      </configfile>
-  </configfiles>
-  <tests>
-      <test>
-          <param name="input" value="unix_sed_input1.txt" />
-          <output name="output" file="unix_sed_output1.txt" />
-          <param name="url_paste"  value="1d ; s/foo/bar/" />
-          <param name="silent" value="" />
-      </test>
-      <test>
-          <param name="input" value="unix_sed_input1.txt" />
-          <output name="output" file="unix_sed_output2.txt" />
-          <param name="url_paste"  value="/foo/ { s/foo/baz/g ; p }" />
-          <param name="silent" value="silent" />
-      </test>
-  </tests>
-  <outputs>
-    <data format="input" name="output" metadata_source="input" />
-  </outputs> 
-<help>
-
+        </configfile>
+    </configfiles>
+    <outputs>
+        <data format="input" name="output" metadata_source="infile" />
+    </outputs>
+    <tests>
+        <test>
+            <param name="infile" value="unix_sed_input1.txt" />
+            <param name="url_paste"  value="1d ; s/foo/bar/" />
+            <param name="silent" value="" />
+            <output name="output" file="unix_sed_output1.txt" />
+        </test>
+        <test>
+            <param name="infile" value="unix_sed_input1.txt" />
+            <param name="url_paste"  value="/foo/ { s/foo/baz/g ; p }" />
+            <param name="silent" value="silent" />
+            <output name="output" file="unix_sed_output2.txt" />
+        </test>
+    </tests>
+    <help>
+<![CDATA[
 **What it does**
 
 This tool runs the unix **sed** command on the selected data file.
@@ -120,5 +126,7 @@
 
 **Note**: SED uses extended regular expression syntax, not Perl syntax. **\\d**, **\\w**, **\\s** etc. are **not** supported.
 
+@REFERENCES@
+]]>
 </help>
 </tool>