cookies060809/moonreview/cmd/moonreview does not have a README file

    IoError

    type IoError

    输入层的错误。BadLine 用来把解析器报的行号错误归到同一个类型里, 这样 main 只需要 catch 一次。

    IoError::message

    fn IoError::message(self : IoError) -> String

    FileHandle

    type FileHandle

    Parsed

    ask_for_review

    fn ask_for_review(d :
    Diff
    ) -> (Bool, String) raise IoError

    (是否成功, 给人看的输出)。失败原因也走这个元组,好让调用方统一决定退出码。

    exit_with

    fn exit_with(code : Int) -> Unit

    read_file

    fn read_file(path : String) -> String raise IoError

    read_stdin

    fn read_stdin() -> String raise IoError

    remove_file

    fn remove_file(path : String) -> Unit

    尽力而为地删掉临时文件:删不掉也不该盖掉真正的错误。

    run_command

    fn run_command(cmd : String) -> Int

    返回 shell 的退出码。命令串必须是常量,见 @diff.curl_command。

    write_text_file

    fn write_text_file(path : String, text : String) -> Unit raise IoError