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
See morelet flag = try! Flag(longName: "debug", type: Int.self, required: true)
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
See more// 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
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 currentCommand
. ACommandHelp
represents all the info required to print the help message of a command.a
See moreHelpGenerator
is created and passed thisCommandHelp
. theHelpGenerator
is used to print the help message stringDeclaration
Swift
public struct CommandHelp
-
Structure that represent the information about a flag
See moreDeclaration
Swift
public struct FlagHelp
-
Guaka global configurations. Contains config to change global settings.
- Changing the global help message strategy
Declaration
Swift
public struct GuakaConfig