Skip to content

Commit

Permalink
Merge pull request #36 from Carthage/update-result-documentations
Browse files Browse the repository at this point in the history
Reflect Result's parameterized error to documentations
  • Loading branch information
mdiep committed Oct 20, 2015
2 parents 804ec2d + 6ac21e2 commit d7c46a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Commandant/Option.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Result
/// return LogOptions(verbosity: verbosity, outputFilename: outputFilename, logName: logName)
/// }
///
/// static func evaluate(m: CommandMode) -> Result<LogOptions> {
/// static func evaluate(m: CommandMode) -> Result<LogOptions, CommandantError<YourErrorType>> {
/// 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")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<YourErrorType>> {
return LogOptions.evaluate(mode).map { options in
// Use the parsed options to do something interesting here.
return ()
Expand All @@ -28,7 +28,7 @@ struct LogOptions: OptionsType {
return LogOptions(lines: lines, verbose: verbose, logName: logName)
}

static func evaluate(m: CommandMode) -> Result<LogOptions> {
static func evaluate(m: CommandMode) -> Result<LogOptions, CommandantError<YourErrorType>> {
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")
Expand Down

0 comments on commit d7c46a3

Please # to comment.