diff options
| author | Charles.Forsyth <devnull@localhost> | 2007-06-01 16:04:53 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2007-06-01 16:04:53 +0000 |
| commit | fa4eff3d4c2648089c3834f801e45c74bd420676 (patch) | |
| tree | b230ef0bb8ebdb04ad120df0a77effb22c768ba4 | |
| parent | 0d13e2d8f571afd10965c136375ea336c9f5d9f2 (diff) | |
20070601-1703
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | appl/cmd/ls.b | 14 | ||||
| -rw-r--r-- | dis/ls.dis | bin | 3890 -> 4025 bytes | |||
| -rw-r--r-- | man/1/ls | 19 |
4 files changed, 32 insertions, 2 deletions
@@ -1,4 +1,5 @@ 20070601 + /appl/cmd/ls.b /dis/ls.dis /man/1/ls: document new -F option and -T option /appl/cmd/auth/factotum/factotum.b: ignore empty writes, don't fail; make a few diagnostics match plan 9 rename /appl/cmd/mc.b to /appl/cmd/calc.b; also /man/1/mc to /man/1/calc; /dis/mc.dis to /dis/calc.dis add /appl/cmd/mc.b (initial version) diff --git a/appl/cmd/ls.b b/appl/cmd/ls.b index 3d27d59e..6ffe29fb 100644 --- a/appl/cmd/ls.b +++ b/appl/cmd/ls.b @@ -39,6 +39,7 @@ qopt := 0; sopt := 0; topt := 0; uopt := 0; +Fopt := 0; Topt := 0; now: int; sortby: int; @@ -112,6 +113,8 @@ init(nil: ref Context, argv: list of string) rev = Readdir->DESCENDING; 'T' => Topt++; + 'F' => + Fopt++; * => sys->fprint(stderr, "usage: ls [-delmnpqrstucT] [files]\n"); raise "fail:usage"; @@ -271,6 +274,8 @@ lslineprint(dirname, name: string, dir: ref Dir, w: ref Widths) else file = dirname + "/" + file; } + if(Fopt) + file += fileflag(dir); if(lopt) { @@ -291,6 +296,15 @@ lslineprint(dirname, name: string, dir: ref Dir, w: ref Widths) out.puts(file+"\n"); } +fileflag(dir: ref Dir): string +{ + if(dir.qid.qtype & Sys->QTDIR) + return "/"; + if(dir.mode & 8r111) + return "*"; + return ""; +} + mtab := array[] of { "---", "--x", "-w-", "-wx", "r--", "r-x", "rw-", "rwx" Binary files differ@@ -4,14 +4,14 @@ ls, lc \- list files .SH SYNOPSIS .B ls [ -.B -lpmnqduntscr +.B -lpmnqduntscrFT ] [ .IR file ... ] .LP .B lc [ -.B -lpmnqduntscr +.B -lpmnqduntscrFT ] [ .IR file ... ] @@ -141,6 +141,21 @@ Sort by size (smallest first). .TP .B -r Reverse the sort order. +.TP +.B -F +Add the character +.B / +after all directory names +and the character +.B * +after all executable files. +.TP +.B -T +Print the character +.B t +before each file if it has the temporary flag set, and +.B - +otherwise. .PP .I Lc is the same as |
