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 /appl/cmd | |
| parent | 0d13e2d8f571afd10965c136375ea336c9f5d9f2 (diff) | |
20070601-1703
Diffstat (limited to 'appl/cmd')
| -rw-r--r-- | appl/cmd/ls.b | 14 |
1 files changed, 14 insertions, 0 deletions
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" |
