|
35 | 35 | commands = map[string]cmdfunc{ |
36 | 36 | "": noop, |
37 | 37 | "dbg": dbg, |
| 38 | + "help": help, |
38 | 39 | "lsblk": lsblk, |
39 | 40 | "mount": mount, |
40 | 41 | "umount": umount, |
@@ -160,6 +161,28 @@ func runCommand(line string) { |
160 | 161 |
|
161 | 162 | func noop(argv []string) {} |
162 | 163 |
|
| 164 | +func help(argv []string) { |
| 165 | + fmt.Printf("help\r\n") |
| 166 | + fmt.Printf(" show help\r\n") |
| 167 | + fmt.Printf("dbg\r\n") |
| 168 | + fmt.Printf(" toggle debug mode\r\n") |
| 169 | + fmt.Printf("xxd <hex address, ex: 0xA0> <size of hexdump in bytes>\r\n") |
| 170 | + fmt.Printf(" hexdump the specified address\r\n") |
| 171 | + fmt.Printf("ls <target file>\r\n") |
| 172 | + fmt.Printf(" list information\r\n") |
| 173 | + fmt.Printf("samples\r\n") |
| 174 | + fmt.Printf(" write some files in the root directory\r\n") |
| 175 | + fmt.Printf("mkdir <target dir>\r\n") |
| 176 | + fmt.Printf(" create directory\r\n") |
| 177 | + fmt.Printf("cat <target file>\r\n") |
| 178 | + fmt.Printf(" print the contents of file\r\n") |
| 179 | + fmt.Printf("create <target file>\r\n") |
| 180 | + fmt.Printf(" create file\r\n") |
| 181 | + fmt.Printf("write <target file>\r\n") |
| 182 | + fmt.Printf(" write to file (press CTRL-D to exit)\r\n") |
| 183 | + fmt.Printf("rm\r\n") |
| 184 | +} |
| 185 | + |
163 | 186 | func dbg(argv []string) { |
164 | 187 | if debug { |
165 | 188 | debug = false |
@@ -421,7 +444,7 @@ func cat(argv []string) { |
421 | 444 | println("Trying to cat to " + tgt) |
422 | 445 | } |
423 | 446 | if tgt == "" { |
424 | | - println("Usage: cat <target dir>") |
| 447 | + println("Usage: cat <target file>") |
425 | 448 | return |
426 | 449 | } |
427 | 450 | if debug { |
|
0 commit comments