From 6ac21e2e0f2abcc5e949f848521a7296f8832df1 Mon Sep 17 00:00:00 2001 From: Syo Ikeda Date: Tue, 20 Oct 2015 22:03:56 +0900 Subject: [PATCH] Reflect Result's parameterized error to documentations --- Commandant/Option.swift | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Commandant/Option.swift b/Commandant/Option.swift index 05d6dfa..5c29ad6 100644 --- a/Commandant/Option.swift +++ b/Commandant/Option.swift @@ -26,7 +26,7 @@ import Result /// return LogOptions(verbosity: verbosity, outputFilename: outputFilename, logName: logName) /// } /// -/// static func evaluate(m: CommandMode) -> Result { +/// static func evaluate(m: CommandMode) -> Result> { /// return create /// <*> m <| Option(key: "verbose", defaultValue: 0, usage: "the verbosity level with which to read the logs") /// <*> m <| Option(key: "outputFilename", defaultValue: "", usage: "a file to print output to, instead of stdout") diff --git a/README.md b/README.md index e05e14f..c37cda6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ struct LogCommand: CommandType { let verb = "log" let function = "Reads the log" - func run(mode: CommandMode) -> Result<()> { + func run(mode: CommandMode) -> Result<(), CommandantError> { return LogOptions.evaluate(mode).map { options in // Use the parsed options to do something interesting here. return () @@ -28,7 +28,7 @@ struct LogOptions: OptionsType { return LogOptions(lines: lines, verbose: verbose, logName: logName) } - static func evaluate(m: CommandMode) -> Result { + static func evaluate(m: CommandMode) -> Result> { return create <*> m <| Option(key: "lines", defaultValue: 0, usage: "the number of lines to read from the logs") <*> m <| Option(key: "verbose", defaultValue: false, usage: "show verbose output")