示例#1
0
func handleMkdir(ctx *cli.Context, client *daemon.Client) error {
	path := prefixSlash(ctx.Args().First())

	var err error

	if ctx.Bool("parents") {
		err = client.MkdirAll(path)
	} else {
		err = client.Mkdir(path)
	}

	if err != nil {
		return ExitCode{
			UnknownError,
			fmt.Sprintf("mkdir failed: %v", err),
		}
	}

	return nil
}