From 4039384e0dbec011f5cb2385676331ad16966e3f Mon Sep 17 00:00:00 2001 From: icanswiftabit Date: Fri, 26 Jun 2020 12:48:50 +0200 Subject: [PATCH] change: `CommandError` and `MessageInfo` to public --- Sources/ArgumentParser/Parsing/CommandParser.swift | 4 ++-- Sources/ArgumentParser/Usage/MessageInfo.swift | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/ArgumentParser/Parsing/CommandParser.swift b/Sources/ArgumentParser/Parsing/CommandParser.swift index 1ab4ebd8c..3167ef602 100644 --- a/Sources/ArgumentParser/Parsing/CommandParser.swift +++ b/Sources/ArgumentParser/Parsing/CommandParser.swift @@ -9,8 +9,8 @@ // //===----------------------------------------------------------------------===// -struct CommandError: Error { - var commandStack: [ParsableCommand.Type] +public struct CommandError: Error { + public var commandStack: [ParsableCommand.Type] var parserError: ParserError } diff --git a/Sources/ArgumentParser/Usage/MessageInfo.swift b/Sources/ArgumentParser/Usage/MessageInfo.swift index 4c4948b51..c2cb7ccd0 100644 --- a/Sources/ArgumentParser/Usage/MessageInfo.swift +++ b/Sources/ArgumentParser/Usage/MessageInfo.swift @@ -11,12 +11,12 @@ @_implementationOnly import Foundation -enum MessageInfo { +public enum MessageInfo { case help(text: String) case validation(message: String, usage: String) case other(message: String, exitCode: Int32) - init(error: Error, type: ParsableArguments.Type) { + public init(error: Error, type: ParsableArguments.Type) { var commandStack: [ParsableCommand.Type] var parserError: ParserError? = nil @@ -93,7 +93,7 @@ enum MessageInfo { } } - var message: String { + public var message: String { switch self { case .help(text: let text): return text @@ -104,7 +104,7 @@ enum MessageInfo { } } - var fullText: String { + public var fullText: String { switch self { case .help(text: let text): return text @@ -123,7 +123,7 @@ enum MessageInfo { } } - var exitCode: ExitCode { + public var exitCode: ExitCode { switch self { case .help: return ExitCode.success case .validation: return ExitCode.validationFailure