|
|
|
@ -26,8 +26,8 @@ var ( |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
func cmd_generic(tbm *TBM, command string, args []string) error { |
|
|
|
|
cmd := &Command{command, args} |
|
|
|
|
func cmd_generic(tbm *TBM, command string, args []string, payload []byte) error { |
|
|
|
|
cmd := &Command{command, args, payload} |
|
|
|
|
tbm.Commands <- cmd |
|
|
|
|
res := <-tbm.Results |
|
|
|
|
|
|
|
|
@ -40,43 +40,43 @@ func cmd_generic(tbm *TBM, command string, args []string) error { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_ls(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "mufs ls", args) |
|
|
|
|
return cmd_generic(tbm, "mufs ls", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_cat(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "mufs cat", args) |
|
|
|
|
return cmd_generic(tbm, "mufs cat", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_stat(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "mufs stat", args) |
|
|
|
|
return cmd_generic(tbm, "mufs stat", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_cp(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "mufs cp", args) |
|
|
|
|
return cmd_generic(tbm, "mufs cp", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_rm(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "mufs rm", args) |
|
|
|
|
return cmd_generic(tbm, "mufs rm", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_mkdir(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "mufs mkdir", args) |
|
|
|
|
return cmd_generic(tbm, "mufs mkdir", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_rmdir(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "mufs rmdir", args) |
|
|
|
|
return cmd_generic(tbm, "mufs rmdir", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_date(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "date", args) |
|
|
|
|
return cmd_generic(tbm, "date", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_set_date(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "set-date", args) |
|
|
|
|
return cmd_generic(tbm, "set-date", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func cmd_time(tbm *TBM, args []string) error { |
|
|
|
|
return cmd_generic(tbm, "time", args) |
|
|
|
|
return cmd_generic(tbm, "time", args, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|