Skip to content

Releases: vapor/console-kit

ConsoleKit 4.0.0 Beta 1

24 Oct 18:55
5b91c2d
Compare
Choose a tag to compare
Pre-release
  • CommandError is now an enum. (#122)
  • ConsoleLogger now stores the logging bootstrap's label during creation. (#123)

Notes: This change allows ConsoleLogger to print the label used for its creation when at .trace log level.

ConsoleKit v4.0.0-alpha.3

16 Oct 22:34
Compare
Choose a tag to compare
Pre-release

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

28 Aug 15:52
00ce1ab
Compare
Choose a tag to compare
Pre-release
  • 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

27 Aug 22:19
58d000a
Compare
Choose a tag to compare
Pre-release
  • Command signatures are now declared using property wrappers (#116, #115)

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 and Group 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

29 May 16:03
252a8b8
Compare
Choose a tag to compare

Console 3.1.1

22 Mar 13:22
74cfbea
Compare
Choose a tag to compare

Fixed

  • Only extract a short flag if the raw flag string is -<short> (#94)

Console 3.1.0

08 Nov 20:52
d6cf07a
Compare
Choose a tag to compare

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 the Console protocol, which initializes a new CustomActivity 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

06 Nov 14:35
aa38c8a
Compare
Choose a tag to compare

Only logs command help when there are errors in command usage, no longer logs errors in the command execution.

Console 3.0.3

30 Oct 21:32
96617dc
Compare
Choose a tag to compare

Fixed:

  • Fixes an issue where ephemeral messages would not clear correctly. (#80)

Console 3.0.2

02 May 20:30
Compare
Choose a tag to compare

New:

  • -e short flag now supported for setting environment.