Releases: vapor/console-kit
ConsoleKit 4.0.0 Beta 1
ConsoleKit v4.0.0-alpha.3
Maybe You Meant 'Beta'?
No, this isn't supposed to be a beta release; but we do have suggestions! Command suggestions at that! If pass in a command that doesn't exist, ConsoleKit will automatically check to see if there are any commands with a similar name and suggest that maybe you meant one of them instead.
A big thanks to @tkrajacic for implementing this feature!
ConsoleKit 4.0.0 Alpha 2.1
- Added
projectedValue
to@Argument
,@Option
, and@Flag
property wrappers. (#118)
Notes: This allows for the property wrapper backing for these signature arguments to be accessed from the command. To access, prefix the argument name with
$
.
ConsoleKit 4.0.0 Alpha 2
Here's an example command signature using the new API:
struct Cowsay: Command {
struct Signature: CommandSignature {
@Argument(name: "message", help: "What the cow should say")
var message: String
@Option(name: "eyes", short: "e", help: "Change the cow's eyes")
var eyes: String?
@Option(name: "tongue", short: "t", help: "Change the cow's tongue")
var tongue: String?
@Flag(name: "borg", help: "uses == for cow's eyes")
var borg: Bool
init() { }
}
let help = "Prints an ASCII cow with a message"
func run(context: CommandContext, signature: Signature) throws {
print(signature.message) // String
print(signature.eyes) // String?
print(signature.tongue) // String?
print(signature.borg) // Bool
}
}
- New type-erased protocols for
Command
andGroup
allow for dynamic commands to be implemented (#115, #113)
struct DynamicCommand: AnyCommand {
var help: String = ""
func run(using context: inout CommandContext) throws {
XCTAssertEqual(context.input.arguments, ["true", "--count", "42"])
}
}
ConsoleKit 4.0.0 Alpha 1
More information on Vapor 4 alpha releases:
https://medium.com/@codevapor/vapor-4-alpha-1-releases-begin-94a4bc79dd9a
API Docs:
https://api.vapor.codes/console-kit/master/ConsoleKit/index.html
Console 3.1.1
Fixed
- Only extract a short flag if the raw flag string is
-<short>
(#94)
Console 3.1.0
New:
- Created
CustomActivity
activity indicator type. this lets you easily create custom activity indicators with a series of characters that are looped over for the animation. - Added a
customActivity
method to theConsole
protocol, which initializes a newCustomActivity
instance.
let indicator = context.console.customActivity(frames: ["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"])
_ = try indicator.start(on: context.container)
// Do something that takes a long time.
indicator.succeed()
Console 3.0.4
Only logs command help when there are errors in command usage, no longer logs errors in the command execution.
Console 3.0.3
Fixed:
- Fixes an issue where ephemeral messages would not clear correctly. (#80)
Console 3.0.2
New:
-e
short flag now supported for setting environment.