Source code

Download source archive ↓

upstream-extended/community/tools/text_processing/text_processing/nl.xml

1<tool id="nl" name="Number lines" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2    <description></description>
3    <macros>
4        <import>macros.xml</import>
5    </macros>
6    <expand macro="creator"/>
7    <expand macro="requirements" />
8    <version_command>nl --version | head -n 1</version_command>
9    <command><![CDATA[
10    nl
11        --line-increment=$line_increment
12        --starting-line-number=$starting_line_number
13        --number-format=$number_format
14        --number-width=$number_width
15        '$input'
16        > '$output'
17    ]]></command>
18    <inputs>
19        <param name="input" format="txt" type="data" label="File to number" />
20        <param argument="--line-increment" type="integer" value="1" label="Line number increment at each line"/>
21        <param argument="--starting-line-number" type="integer" value="1" label="First line number"/>
22        <param argument="--number-format" type="select" label="Line number format">
23            <option value="ln">left justified, no leading zeros</option>
24            <option value="rn" selected="true">right justified, no leading zeros</option>
25            <option value="rz">right justified, leading zeros</option>
26        </param>
27        <param argument="--number-width" type="integer" min="1" value="6" label="Number of characters for line numbers"/>
28    </inputs>
29    <outputs>
30        <data format_source="input" name="output"/>
31    </outputs>
32    <tests>
33        <test>
34            <param name="input" value="cut1.txt" ftype="tabular"/>
35            <output name="output" file="nl-out.txt" ftype="tabular"/>
36        </test>
37        <test>
38            <param name="input" value="cut1.txt" ftype="tabular"/>
39            <param name="number_format" value="ln"/>
40            <param name="number_width" value="1"/>
41            <output name="output" file="nl-out-number-format.txt" ftype="tabular">
42                <assert_contents>
43                    <!-- no filling spaces -->
44                    <has_text text=" " negate="true"/>
45                </assert_contents>
46            </output>
47        </test>
48        <test>
49            <param name="input" value="cut1.txt" ftype="tabular"/>
50            <param name="line_increment" value="2"/>
51            <param name="starting_line_number" value="10"/>
52            <output name="output" file="nl-start-incr.txt" ftype="tabular"/>
53        </test>
54    </tests>
55    <help>
56<![CDATA[
57**What it does**
58
59Add line numbers to the data set.
60]]>
61  </help>
62  <expand macro="citations" />
63</tool>