def do_cat(self, command):
        """cat <interface> <file> [-b]: shows the content of target file on 'interface'
if --binary is specified, print all bytes directly.
otherwise, print repr(content)[1:-1]
"""
        fsi, args = self.parse_fs_command(command, nargs=-1, ret=tuple)
        if (fsi is None) or (args is None):
            return
        if len(args) == 2:
            if args[1] in ("-b", "--binary"):
                # never print nullbytes until explictly told.
                binary = True
            else:
                self.stdout.write(Text("Error: Unknown read-mode!\n", "red"))
                return
            name, binary = args[0], binary
        elif len(args) not in (1, 2):
            self.stdout.write(Text("Error: invalid argument count!\n", "red"))
            return
        else:
            name, binary = args[0], False
        self.stdout.write("Reading file... ")
        try:
            f = fsi.open(name, "r" + ("b" if binary else ""))
            content = f.read()
        except IsDir:
            self.stdout.write(Text("Error: expected a filepath!\n", "red"))
        except OperationFailure as e:
            self.stdout.write(Text("Error: {m}\n".format(m=e.message), "red"))
        else:
            self.stdout.write(Text("Done", "green"))
            self.stdout.write(".\n")
            if not binary:
                content = repr(content)[1:-1]
            self.stdout.write(Text("=" * 25, "yellow"))
            self.stdout.write("\n{c}\n".format(c=content))
            self.stdout.write(Text("=" * 25, "yellow"))
            self.stdout.write("\n")
        finally:
            try:
                f.close()
            except:
                pass
cat <interface> <file> [-b]: shows the content of target file on 'interface'
if --binary is specified, print all bytes directly.
otherwise, print repr(content)[1:-1]

bin/mc.py