From 9561c703e5fe662fb3584075c246e331756ad05b Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Sat, 4 Nov 2017 23:22:38 -0500 Subject: [PATCH] Added implementation for help property in Configuration class --- Sources/Ether/Configuration.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/Ether/Configuration.swift b/Sources/Ether/Configuration.swift index b890537..7bfa1aa 100644 --- a/Sources/Ether/Configuration.swift +++ b/Sources/Ether/Configuration.swift @@ -38,6 +38,11 @@ public class Configuration: Command { ]) ] + public let help: [String] = [ + "Configure custom actions to occure when a command is run", + "Run `config help` to get information on expected data for the command options" + ] + public let console: ConsoleProtocol public init(console: ConsoleProtocol) { @@ -55,7 +60,7 @@ public class Configuration: Command { do { val = try value("value", from: arguments) } catch { - if key == "help" { self.help() } + if key == "help" { printHelp() } return } @@ -75,7 +80,7 @@ public class Configuration: Command { setBar.finish() } - fileprivate func help() { + fileprivate func printHelp() { let help = """ Below are the keys, values, and expected types for the configuration JSON.