~ubuntu-branches/ubuntu/feisty/kaptain/feisty

« back to all changes in this revision

Viewing changes to grammars/ls.kaptn

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2003-08-02 14:53:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20030802145333-o50ad69xa37dyl8m
Tags: 1:0.71-1.1
* NMU
* Fix build-depends.  Closes: #197848

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/kaptain
2
 
 
3
 
# This makes the shell execute kaptain.
4
 
# For kaptain, it's just another rule.
5
 
# The advantage is, that the bang with the fixed path is not needed.
6
 
# It would be nice, if a `:' at the beginning of a line was recognized
7
 
# as comment character
8
 
exec "kaptain" "$0" "$@"
9
 
    -> @;
10
 
 
11
 
start "List Short" -> descr ecommand buttons;
12
 
 
13
 
descr -> @text (
14
 
"GUI interface to the famous `ls' (list short) command."
15
 
);
16
 
ecommand -> "e_cmd () { echo \"cmd # $1\"; eval \"$1\"; }; e_cmd '" command "'";
17
 
 
18
 
command -> "ls" args;
19
 
 
20
 
args -> scope fformat forder fmoreargs;
21
 
 
22
 
scope :horizontal :framed -> hidden recursion;
23
 
 
24
 
hidden "Hidden files" "Show files starting with a period" -> all | almostall | !nohidden;
25
 
all "all" "Do not hide entries starting with ." -> " -a";
26
 
almostall "almost all" "Do not list implied . and .." -> " -A";
27
 
nohidden "no hidden files" "Do not show hidden files" -> @;
28
 
 
29
 
recursion "Recursion" -> recurse | !norecurse | nodirs;
30
 
recurse  "Recurse" "Recurse into subdirectories" -> " -R";
31
 
norecurse "Normal" "Do not recurse into subdirectories" -> @;
32
 
nodirs "Directory entries" "List directory entries instead of contents" -> " -d";
33
 
 
34
 
fformat :framed -> format;
35
 
format :horizontal "Format" -> col type;
36
 
 
37
 
col :horizontal -> single | long | ! columns;
38
 
single "Single" "Single column output" -> " -1";
39
 
long "Long" "Long listing format" -> " -l";
40
 
columns "Columns" "Standard multi-column format" -> @;
41
 
 
42
 
type "Classify" "Append indicator (one of */=@|) to entries" -> " -F"| @;
43
 
 
44
 
forder :framed -> order;
45
 
order :double "Order" -> time | extension | version | size | !none | filesys;
46
 
extension "Extension" -> " --sort=extension";
47
 
size "Size" -> " --sort=size";
48
 
filesys "File system" -> " --sort=none";
49
 
time "Time" -> " --sort=time";
50
 
version "Version" -> " --sort=version";
51
 
none "Name" -> @;
52
 
 
53
 
fmoreargs :framed -> moreargs;
54
 
moreargs "Arguments" -> useargs;
55
 
useargs :horizontal "Use" -> !@ | " " @string="${KAPTAIN_SCRIPT_ARGS}";
56
 
 
57
 
buttons:horizontal -> @echo( command )="Echo" @action(ecommand)="Do it!" @close="Dismiss" help;
58
 
 
59
 
help :dialog "Help" -> @edit( "courier", 500, 400 )=`mf () { sed 's,.,,g;'; }; PAGER=cat man ls | mf` @close="OK";
60
 
#help :dialog "Help" -> @edit("courier")=`ls --help` @close="OK";
61
 
#help :dialog "Help" -> @text( `ls --help` ) @close="OK";
62
 
 
63
 
# Local Variables:
64
 
# mode: perl
65
 
# End: