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
8
exec "kaptain" "$0" "$@"
11
start "List Short" -> descr ecommand buttons;
14
"GUI interface to the famous `ls' (list short) command."
16
ecommand -> "e_cmd () { echo \"cmd # $1\"; eval \"$1\"; }; e_cmd '" command "'";
20
args -> scope fformat forder fmoreargs;
22
scope :horizontal :framed -> hidden recursion;
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" -> @;
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";
34
fformat :framed -> format;
35
format :horizontal "Format" -> col type;
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" -> @;
42
type "Classify" "Append indicator (one of */=@|) to entries" -> " -F"| @;
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";
53
fmoreargs :framed -> moreargs;
54
moreargs "Arguments" -> useargs;
55
useargs :horizontal "Use" -> !@ | " " @string="${KAPTAIN_SCRIPT_ARGS}";
57
buttons:horizontal -> @echo( command )="Echo" @action(ecommand)="Do it!" @close="Dismiss" help;
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";