Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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