Structures

The following structures are available globally.

  • Flag struct representing a flag


    Example:

    Create a flag with a default value

    let flag = try! try! Flag(longName: "debug", shortName: "d", value: true, description: "Here is a desc")
    

    Create a non required flag without value

    let flag = try! Flag(longName: "debug", type: Int.self)
    

    Create a required flag without value

    let flag = try! Flag(longName: "debug", type: Int.self, required: true)
    
    See more

    Declaration

    Swift

    public struct Flag : Hashable
  • Flags represent an abstraction on a list of flags It provides method to get the flags by name And functions to get int, string, bool and custom types


    Example

    // flags: Flags
    flags.getInt(name: "verbose") // return integer value of flag verbose if possible
    flags.getBool(name: "verbose") // return boolean value of flag verbose if possible
    flags.getString(name: "user") // return string value of flag user if possible
    flags.get(name: "debug", type: YourType.self) // get the value of debug if it is of YourType
    
    See more

    Declaration

    Swift

    public struct Flags
  • Structure that represents a Command information.

    When the help is about to be printed, a CommandHelp is generated from the current Command. A CommandHelp represents all the info required to print the help message of a command.

    a HelpGenerator is created and passed this CommandHelp. the HelpGenerator is used to print the help message string

    See more

    Declaration

    Swift

    public struct CommandHelp
  • Guaka global configurations. Contains config to change global settings.

    • Changing the global help message strategy
    See more

    Declaration

    Swift

    public struct GuakaConfig