summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.gui.widgets.console_mode.html
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-02-15 14:42:20 +0100
committerhut <hut@lavabit.com>2010-02-15 21:40:47 +0100
commitb8d08418a72a71526a6dbac167e9588f5002610f (patch)
tree62dc07ec2ae194654c083e1fbc60a564da2d492e /doc/pydoc/ranger.gui.widgets.console_mode.html
parent621a1a39cf9811c1b5941c267710fb1dafee4657 (diff)
downloadranger-b8d08418a72a71526a6dbac167e9588f5002610f.tar.gz
commands: fixed cd command in quickconsole
Diffstat (limited to 'doc/pydoc/ranger.gui.widgets.console_mode.html')
0 files changed, 0 insertions, 0 deletions
29f50950806c540fdbfd6f9540f3'>^
db9932a9 ^
c8e41a47 ^

db9932a9 ^
c8e41a47 ^





db9932a9 ^

c8e41a47 ^
16cf8273 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

                                                                          





                                       
 
                                                           
                                                          










                                                            
     

                                                                
     

                                                          
     





                                                   

     
          
 
# accept a filename on the commandline, read it and print it out to screen
# only ascii right now, just like the rest of Mu
#
# To run:
#   $ ./translate_mu apps/print-file.mu
#   $ echo abc > x
#   $ ./a.elf x
#   abc

fn main _args: (addr array addr array byte) -> _/ebx: int {
  var args/eax: (addr array addr array byte) <- copy _args
  var n/ecx: int <- length args
  compare n, 1
  {
    break-if->
    print-string 0, "usage: cat <filename>\n"
    return 0
  }
  {
    break-if-<=
    var filename/edx: (addr addr array byte) <- index args 1
    var in: (handle buffered-file)
    {
      var addr-in/eax: (addr handle buffered-file) <- address in
      open *filename, 0, addr-in
    }
    var _in-addr/eax: (addr buffered-file) <- lookup in
    var in-addr/ecx: (addr buffered-file) <- copy _in-addr
    {
      var c/eax: byte <- read-byte-buffered in-addr
      compare c, 0xffffffff  # EOF marker
      break-if-=
      var g/eax: grapheme <- copy c
      print-grapheme 0, g
      loop
    }
  }
  return 0
}