Added shell command: cmp.
[jnode:svn-mirror.git] / cli / descriptors / org.jnode.command.file.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE plugin SYSTEM "jnode.dtd">
3
4 <plugin id="org.jnode.command.file"
5         name="JNode file commands"
6         version="@VERSION@"
7         provider-name="@PROVIDER@"
8         license-name="lgpl">
9
10   <requires>
11     <import plugin="org.jnode.command.argument"/>
12     <import plugin="org.jnode.command.util"/>
13     <import plugin="org.jnode.driver"/>
14     <import plugin="org.jnode.fs"/>
15     <import plugin="org.jnode.fs.service"/>
16     <import plugin="org.jnode.shell.syntax"/>
17     <import plugin="org.jnode.util"/>
18   </requires>
19   
20   <runtime>
21     <library name="jnode-cli.jar">
22       <export name="org.jnode.command.file.*"/>
23     </library>
24   </runtime>
25   
26   <extension point="org.jnode.shell.aliases">
27     <alias name="cat"     class="org.jnode.command.file.CatCommand"/>
28     <alias name="cd"      class="org.jnode.command.file.CdCommand" internal="yes"/>
29     <alias name="cmp"     class="org.jnode.command.file.CmpCommand"/>
30     <alias name="cp"      class="org.jnode.command.file.CpCommand"/>
31     <alias name="cut"     class="org.jnode.command.file.CutCommand"/>
32     <alias name="del"     class="org.jnode.command.file.DeleteCommand"/>
33     <alias name="df"      class="org.jnode.command.file.DFCommand"/>
34     <alias name="dir"     class="org.jnode.command.file.DirCommand"/>
35     <alias name="du"      class="org.jnode.command.file.DuCommand"/>    
36     <alias name="find"    class="org.jnode.command.file.FindCommand"/>
37     <alias name="grep"    class="org.jnode.command.file.GrepCommand"/>
38     <alias name="head"    class="org.jnode.command.file.HeadCommand"/>
39     <alias name="hexdump" class="org.jnode.command.file.HexdumpCommand"/>
40     <alias name="ls"      class="org.jnode.command.file.DirCommand"/>
41     <alias name="md5sum"  class="org.jnode.command.file.Md5SumCommand"/>
42     <alias name="mkdir"   class="org.jnode.command.file.MkdirCommand"/>
43     <alias name="paste"   class="org.jnode.command.file.PasteCommand"/>
44     <alias name="pwd"     class="org.jnode.command.file.PwdCommand"/>
45     <alias name="rm"      class="org.jnode.command.file.DeleteCommand"/>
46     <alias name="sort"    class="org.jnode.command.file.SortCommand"/>
47     <alias name="tail"    class="org.jnode.command.file.TailCommand"/>
48     <alias name="tee"     class="org.jnode.command.file.TeeCommand"/>
49     <alias name="touch"   class="org.jnode.command.file.TouchCommand"/>
50     <alias name="wc"      class="org.jnode.command.file.WcCommand"/>
51   </extension>
52   
53   <extension point="org.jnode.shell.syntaxes">
54     <syntax alias="cat">
55       <empty description="copy standard input to standard output"/>
56       <sequence description="concatenate files to standard output">
57         <optionSet>
58           <option argLabel="num-nonblank" shortName="b" longName="number-nonblank"/>
59           <option argLabel="num"          shortName="n" longName="number"/>
60           <option argLabel="squeeze"      shortName="s" longName="sqeeze-blank"/>
61           <option argLabel="show-ends"    shortName="E" longName="show-ends"/>
62         </optionSet>
63         <repeat>
64           <argument argLabel="file"/>
65         </repeat>
66       </sequence>
67       <sequence description="fetch and concatenate urls to standard output">
68         <option argLabel="urls" shortName="u" longName="urls"/>
69         <repeat minCount="1">
70           <argument argLabel="url"/>
71         </repeat>
72       </sequence>
73     </syntax>
74     <syntax alias="cd">
75       <empty description="change the current directory to the 'user.home' directory"/>
76       <argument argLabel="directory" description="change the current directory to 'directory'"/>
77     </syntax>
78     <syntax alias="cmp">
79       <sequence description="compare two files">
80         <argument argLabel="file1"/>
81         <argument argLabel="file2"/>
82       </sequence>
83     </syntax>
84     <syntax alias="cp">
85       <sequence description="copy files or directories">
86         <optionSet>
87           <option argLabel="force"       shortName="f" longName="force"/>
88           <option argLabel="update"      shortName="u" longName="update"/>
89           <option argLabel="interactive" shortName="i" longName="interactive"/>
90           <option argLabel="recursive"   shortName="r" longName="recursive"/>
91           <option argLabel="verbose"     shortName="v" longName="verbose"/>
92         </optionSet>
93         <repeat minCount="1">
94           <argument argLabel="source"/>
95         </repeat>
96         <argument argLabel="target"/>
97       </sequence>
98     </syntax>
99     <syntax alias="cut">
100       <sequence description="select parts of lines">
101         <optionSet>
102           <option argLabel="byte-range"  shortName="b" longName="bytes" />
103           <option argLabel="char-range"  shortName="c" longName="characters"/>
104           <option argLabel="field-range" shortName="f" longName="fields"/>
105           <option argLabel="in-delim"    shortName="d" longName="delimiter"/>
106           <option argLabel="suppress"    shortName="s" longName="only-delimited"/>
107           <option argLabel="complement"  longName="complement"/>
108           <option argLabel="out-delim"   longName="output-delimiter"/>
109         </optionSet>
110         <repeat>
111           <argument argLabel="files"/>
112         </repeat>
113       </sequence>
114     </syntax>
115     <syntax alias="del">
116       <sequence description="delete files and directories">
117         <optionSet>
118           <option argLabel="recursive"   shortName="r" longName="recursive"/>
119           <option argLabel="force"       shortName="f" longName="force" />
120           <option argLabel="interactive" shortName="i" longName="interactive" />
121           <option argLabel="verbose"     shortName="v" longName="verbose" />
122           <option argLabel="onefs"       longName="one-file-system"/>
123         </optionSet>
124         <repeat minCount="1">
125           <argument argLabel="paths"/>
126         </repeat>
127       </sequence>
128     </syntax>
129     <syntax alias="df">
130       <sequence description="display disk usage for file systems">
131         <optionSet>
132           <option argLabel="human-read-bin" shortName="h" longName="human-readable"/>
133           <option argLabel="human-read-dec" shortName="H" longName="si"/>
134           <option argLabel="show-all"       shortName="a" longName="all"/>
135           <option argLabel="block-size"     shortName="B" longName="block-size"/>
136           <option argLabel="block-size-1k"  shortName="k"/>
137           <!--
138           <option argLabel="posix"           shortName="P" longName="portability"/>
139           <option argLabel="inodes"          shortName="i" longName="inodes"/>
140           <option argLabel="local"           shortName="l" longName="local"/>
141           <option argLabel="sync"            longName="sync"/>
142           <option argLabel="no-sync"         longName="no-sync"/>
143           <option argLabel="fs-type"         shortName="t" longName="type"/>
144           <option argLabel="print-type"      shortName="T" longName="print-type"/>
145           <option argLabel="ex-type"         shortName="x" longName="exclude-type"/>
146           -->
147         </optionSet>
148         <optional>
149           <alternatives>
150             <argument argLabel="path"/>
151             <argument argLabel="device"/>
152           </alternatives>
153         </optional>
154       </sequence>
155     </syntax>
156     <syntax alias="dir">
157       <empty description="list the current directory"/>
158       <argument argLabel="path" description="list a file or directory"/>
159     </syntax>
160     <syntax alias="du">
161       <sequence description="Disk Usage - report the amount of disk space used by the specified directory and for each subdirectory.">
162         <repeat minCount="0">
163           <argument argLabel="directory" description="directory to start printing sizes recursively"/>
164         </repeat>
165         <optionSet>
166           <option argLabel="all"                        shortName="a" longName="all"/>
167           <option argLabel="block-size-1"               shortName="b" longName="bytes"/>
168           <option argLabel="total"                      shortName="c" longName="total"/>
169           <option argLabel="derefArgs"                  shortName="D" longName="dereference-args"/>
170           <option argLabel="human-readable-1024"        shortName="h" longName="human-readable"/>
171           <option argLabel="human-readable-1000"        shortName="H" longName="si"/>
172           <option argLabel="block-size-1024"        shortName="k" longName="kilobytes"/>
173           <option argLabel="count-links"                shortName="l" longName="count-links"/>
174           <option argLabel="dereference"                shortName="L" longName="dereference"/>
175           <option argLabel="max-depth"                  shortName=""  longName="max-depth"/> <!-- max-depth has no shortname -->
176           <option argLabel="block-size-1024x1024"   shortName="m" longName="megabytes"/>
177           <option argLabel="summarize"                  shortName="s" longName="summarize"/>
178           <option argLabel="separate-dirs"              shortName="S" longName="separate-dirs"/>
179           <option argLabel="one-file-system"        shortName="x" longName="one-file-system"/> <!-- can't test this currently -->
180           <option argLabel="exclude"                    shortName=""  longName="exclude"/> <!-- exclude has no shortname -->
181           <option argLabel="exclude-from"               shortName="X" longName="exclude-from"/>
182           <option argLabel="block-size-custom"      shortName="B" longName="block-size"/> <!-- not in man page, but works on unix like systems -->
183           <option argLabel="filesystem-block-size"      shortName=""  longName="fs-block-size"/> <!-- testing -->
184         </optionSet>
185       </sequence>
186     </syntax>
187     <syntax alias="find">
188       <sequence description="find files or directories">
189         <repeat minCount="0">
190           <argument argLabel="directory"/>
191         </repeat>
192         <optionSet>
193           <option argLabel="type"     shortName="t" longName="type"/>
194           <option argLabel="maxdepth" shortName="D" longName="maxdepth"/>
195           <option argLabel="mindepth" shortName="d" longName="mindepth"/>
196           <option argLabel="name"     shortName="n" longName="name"/>
197           <option argLabel="iname"    shortName="N" longName="iname"/>
198         </optionSet>
199       </sequence>
200     </syntax>
201     <syntax alias="grep">
202       <!-- grep [Options] <pattern> [<file>...] or
203            grep [Options] (-e <pattern> | -f <file>)... [<file>...] -->
204       <sequence description="Search for lines that match a string or regex">
205         <optionSet>
206           <!-- Matcher type -->
207           <option argLabel="matcher-fixed" shortName="F" longName="fixed-strings"/>
208           <option argLabel="matcher-ext"   shortName="E" longName="extended-regexp"/>
209           <option argLabel="matcher-basic" shortName="G" longName="basic-regexp"/>
210           <option argLabel="matcher-perl"  shortName="P" longName="perl-regexp"/>
211           <!-- Matching options -->
212           <option argLabel="ignore-case" shortName="i" longName="ignore-case"/>
213           <option argLabel="invert"      shortName="v" longName="invert-match"/>
214           <option argLabel="word-match"  shortName="w" longName="word-regexp"/>
215           <option argLabel="line-match"  shortName="x" longName="line-regexp"/>
216           <!-- Output options -->
217           <option argLabel="show-count"         shortName="c" longName="count"/>
218           <option argLabel="show-files-nomatch" shortName="L" longName="files-without-match"/>
219           <option argLabel="show-files-match"   shortName="l" longName="files-with-match"/>
220           <option argLabel="show-only-match"    shortName="o" longName="only-matching"/>
221           <option argLabel="max-matches"        shortName="m" longName="max-count"/>
222           <option argLabel="quiet"              shortName="q" longName="quiet"/>
223           <option argLabel="quiet"              longName="silent"/>
224           <option argLabel="suppress"           shortName="s" longName="no-messages"/>
225           <!-- Output prefix control -->
226           <option argLabel="prefix-byte"   shortName="b" longName="byte-offset"/>
227           <option argLabel="prefix-file"   shortName="H" longName="with-filename"/>
228           <option argLabel="prefix-nofile" shortName="h" longName="no-filename"/>
229           <option argLabel="prefix-label"  longName="label"/>
230           <option argLabel="prefix-line"   shortName="n" longName="line-number"/>
231           <option argLabel="prefix-tab"    shortName="T" longName="initial-tab"/>
232           <option argLabel="prefix-null"   shortName="Z" longName="null"/>
233           <!-- Context lines -->
234           <option argLabel="show-context-after"  shortName="A" longName="after-context"/>
235           <option argLabel="show-context-before" shortName="B" longName="before-context"/>
236           <option argLabel="show-context-both"   shortName="C" longName="context"/>
237           <!-- File/Directory selection -->
238           <option argLabel="mode-binary"          longName="binary-files"/>
239           <option argLabel="mode-binary-text"     shortName="a" longName="text"/>
240           <option argLabel="mode-binary-skip"     shortName="I"/>
241           <option argLabel="mode-device"          shortName="D" longName="devices"/>
242           <option argLabel="mode-dir"             shortName="d" longName="directories"/>
243           <option argLabel="mode-dir-recurse"     shortName="r" longName="recursive"/>
244           <option argLabel="mode-dir-recurse"     shortName="R"/>
245           <option argLabel="pattern-exclude"      longName="exclude"/>
246           <option argLabel="pattern-exclude-file" longName="exclude-from"/>
247           <option argLabel="pattern-exclude-dir"  longName="exclude-dir"/>
248           <option argLabel="pattern-include"      longName="include"/>
249           <!-- Other options -->
250           <option argLabel="null-term" shortName="z" longName="null-data"/>
251           <option argLabel="debug"     longName="debug"/>
252         </optionSet>
253         <alternatives>
254           <repeat minCount="1">
255             <alternatives>
256               <option argLabel="patterns"      shortName="e"/>
257               <option argLabel="pattern-files" shortName="f"/>
258             </alternatives>
259           </repeat>
260           <argument argLabel="patterns"/>
261         </alternatives>
262         <repeat>
263           <argument argLabel="files"/>
264         </repeat>
265       </sequence>
266     </syntax>
267     <syntax alias="head">
268       <sequence>
269         <optionSet>
270           <option argLabel="quiet"   shortName="q" longName="quiet"/>
271           <option argLabel="quiet"   longName="silent"/>
272           <option argLabel="verbose" shortName="v" longName="verbose"/>
273           <option argLabel="bytes"   shortName="c" longName="bytes"/>
274           <option argLabel="lines"   shortName="n" longName="lines"/>
275         </optionSet>
276         <repeat>
277           <argument argLabel="files" />
278         </repeat>
279       </sequence>
280     </syntax>
281     <syntax alias="hexdump">
282       <empty description="print a hex dump of standard input"/>
283       <argument argLabel="file" description="print a hex dump of a file"/>
284       <option argLabel="url" shortName="u" longName="url" description="print a hex dump of a URL"/>
285     </syntax>
286     <syntax alias="ls">
287       <empty description="with -l, print sizes in human readable format (e.g., 1K 234M 2G)"/>
288       <option argLabel="humanReadable" shortName="h" longName="human-readable"/>
289       <repeat>
290         <argument argLabel="path" description="list files or directories"/>
291       </repeat>
292     </syntax>
293     <syntax alias="md5sum">
294       <empty description="Calculates the MD5 digest for standard input"/>
295       <option argLabel="checkfile" shortName="c" longName="check"/>
296       <sequence description="Calculates the MD5 digests for files">
297         <optional eager="true">
298           <option argLabel="recursive" shortName="r" longName="recursive"/>
299         </optional>
300         <repeat minCount="1">
301           <argument argLabel="paths"/>
302         </repeat>
303       </sequence>
304     </syntax>
305     <syntax alias="mkdir">
306       <argument argLabel="directory" description="create a new directory"/>
307     </syntax>
308     <syntax alias="paste">
309       <empty />
310       <sequence>
311         <optionSet>
312           <option argLabel="serial" shortName="s" longName="serial"/>
313           <option argLabel="delims" shortName="d" longName="delimiters"/>
314         </optionSet>
315         <repeat>
316           <argument argLabel="files"/>
317         </repeat>
318       </sequence>
319     </syntax>
320     <syntax alias="pwd">
321       <empty description="show the pathname for the current directory"/>
322     </syntax>
323     <syntax alias="rm">
324       <sequence description="delete files and directories">
325         <optionSet>
326           <option argLabel="recursive"   shortName="r" longName="recursive"/>
327           <option argLabel="force"       shortName="f" longName="force" />
328           <option argLabel="interactive" shortName="i" longName="interactive" />
329           <option argLabel="verbose"     shortName="v" longName="verbose" />
330         </optionSet>
331         <repeat minCount="1">
332           <argument argLabel="paths"/>
333         </repeat>
334       </sequence>
335     </syntax>
336     <syntax alias="sort">
337         <sequence>
338             <optionSet>
339                 <option argLabel="field"     shortName="k"/>
340                 <option argLabel="output"    shortName="o"/>
341                 <option argLabel="field-sep" shortName="t"/>
342                 <option argLabel="check"     shortName="c"/>
343                 <option argLabel="merge"     shortName="m"/>
344                 <option argLabel="unique"    shortName="u"/>
345                 <option argLabel="reverse"   shortName="r"/>
346                 <option argLabel="cmp-print" shortName="i"/>
347                 <option argLabel="cmp-alpha" shortName="d"/>
348                 <option argLabel="cmp-icase" shortName="i"/>
349                 <option argLabel="no-blanks" shortName="b"/>
350                 <option argLabel="numeric"   shortName="n"/>
351                 <!-- debugging options -->
352                 <option argLabel="sort" longName="sort"/>
353             </optionSet>
354             <repeat>
355                 <argument argLabel="files"/>
356             </repeat>
357         </sequence>
358     </syntax>
359     <syntax alias="tail">
360       <sequence>
361         <optionSet label="globals">
362           <option argLabel="follow"    shortName="f" longName="follow"/>
363           <option argLabel="followr"   shortName="F"/>
364           <option argLabel="retry"     longName="retry"/>
365           <option argLabel="unchanged" longName="max-unchanged-stats"/>
366           <!--<option argLabel="pid" longName="pid"/> disabled -->
367           <option argLabel="sleep"     shortName="s" longName="sleep-interval"/>
368           <option argLabel="quiet"     shortName="q" longName="quiet"/>
369           <option argLabel="verbose"   shortName="v" longName="verbose"/>
370           <option argLabel="bytes"     shortName="c" longName="bytes"/>
371           <option argLabel="lines"     shortName="n" longName="lines"/>
372         </optionSet>
373         <repeat>
374           <argument argLabel="files"/>
375         </repeat>
376       </sequence>
377     </syntax>
378     <syntax alias="tee">
379       <sequence>
380         <optionSet label="globals">
381           <option argLabel="append"    shortName="a" longName="append"/>
382         </optionSet>
383         <repeat>
384           <argument argLabel="files"/>
385         </repeat>
386       </sequence>
387     </syntax>
388     <syntax alias="touch">
389       <argument argLabel="file" description="touch the given file"/>
390     </syntax>
391     <syntax alias="wc">
392       <sequence>
393         <optionSet>
394           <option argLabel="bytes"       shortName="c" longName="bytes"/>
395           <option argLabel="chars"       shortName="m" longName="chars"/>
396           <option argLabel="lines"       shortName="l" longName="lines"/>
397           <option argLabel="worlds"      shortName="w" longName="words"/>
398           <option argLabel="maxCharLine" shortName="L" longName="max-line-length"/>
399         </optionSet>
400         <repeat>
401           <argument argLabel="files"/>
402         </repeat>
403       </sequence>
404     </syntax>
405   </extension>
406   
407   <extension point="org.jnode.security.permissions">
408     <permission class="java.io.FilePermission"       name="&lt;&lt;ALL FILES&gt;&gt;" actions="read,write,delete"/>
409     <permission class="java.lang.RuntimePermission"  name="readFileDescriptor"/>
410     <permission class="java.lang.RuntimePermission"  name="writeFileDescriptor"/>
411     <permission class="java.util.PropertyPermission" name="user.dir" actions="read,write"/>
412     <permission class="java.util.PropertyPermission" name="user.home" actions="read,write"/>
413     <permission class="java.lang.RuntimePermission"  name="getenv.*" actions="read"/>
414     <!--
415     <permission class="java.lang.RuntimePermission"  name="getenv.POSIXLY_CORRECT" actions="read"/>
416     <permission class="java.lang.RuntimePermission" name="getenv.DF_BLOCK_SIZE" actions="read"/>
417     <permission class="java.lang.RuntimePermission" name="genenv.DU_BLOCK_SIZE" actions="read"/>
418     <permission class="java.lang.RuntimePermission" name="getenv.LS_BLOCK_SIZE" actions="read"/>
419     <permission class="java.lang.RuntimePermission" name="getenv.BLOCK_SIZE" actions="read"/>
420     <permission class="java.lang.RuntimePermission" name="getenv.BLOCKSIZE" actions="read"/>
421     -->
422   </extension>
423 </plugin>