changeset 6:22080cbb0e2a

datamash: improve XML tool 1. String fix suggested by Bjoern Gruening. 2. Added input validator to group text box 3. Added minimum "1" operation.
author Assaf Gordon <agordon@wi.mit.edu>
date Sat, 22 Nov 2014 20:37:38 -0500
parents f33abb72cbe3
children 48bbe512639e
files datamash-ops.xml
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/datamash-ops.xml	Sat Nov 22 19:35:48 2014 -0500
+++ b/datamash-ops.xml	Sat Nov 22 20:37:38 2014 -0500
@@ -12,7 +12,7 @@
       $need_sort
       $print_full_line
       $ignore_case
-      #if str($grouping)>0
+      #if str($grouping).strip()
       --group '$grouping'
       #end if
       #for $oper in $operations
@@ -24,7 +24,9 @@
   <inputs>
     <param format="tabular" name="in_file" type="data" label="Select Input Data" help=""/>
 
-    <param name="grouping" label="Group by fields" type="text" help="Example: 1,4 - To group by the first and fourth fields. Leave empty to perform operation on entire file as one group."/>
+    <param name="grouping" label="Group by fields" type="text" help="Example: 1,4 - To group by the first and fourth fields. Leave empty to perform operation on entire file as one group.">
+        <validator type="regex" message="invalid fields value">^[0-9, ]*$</validator>
+    </param>
 
     <param name="header_in" type="boolean" truevalue="--header-in" falsevalue=""
 	label="Input file has a header line" help="Mark this if the input file's first line is a header line" />
@@ -41,7 +43,7 @@
     <param name="ignore_case" type="boolean" truevalue="--ignore-case" falsevalue=""
 	label="Ignore case when grouping" help="If set, upper/lowercase differences will be ignored when grouping fields." />
 
-    <repeat name="operations" title="Operation to perform on each group">
+    <repeat name="operations" title="Operation to perform on each group" min="1" default="1">
       <param name="op_name" type="select" label="Type">
         <option value="count">count</option>
         <option value="sum">sum</option>