feat: Updates cli documentation for utils commands.
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
import ArgumentParser
|
import ArgumentParser
|
||||||
|
|
||||||
struct CreateProjectTemplateCommand: AsyncParsableCommand {
|
struct GenerateProjectTemplateCommand: AsyncParsableCommand {
|
||||||
|
|
||||||
static let commandName = "create-template"
|
static let commandName = "generate-template"
|
||||||
|
|
||||||
static let configuration = CommandConfiguration.playbook(
|
static let configuration = CommandConfiguration.playbook(
|
||||||
commandName: commandName,
|
commandName: commandName,
|
||||||
abstract: "Create a home performance assesment project template.",
|
abstract: "Generate a home performance assesment project template.",
|
||||||
parentCommand: UtilsCommand.commandName,
|
parentCommand: UtilsCommand.commandName,
|
||||||
examples: (label: "Create Template", example: "\(commandName) /path/to/project-template")
|
examples: (label: "Generate Template", example: "\(commandName) /path/to/project-template")
|
||||||
)
|
)
|
||||||
|
|
||||||
@OptionGroup var globals: GlobalOptions
|
@OptionGroup var globals: GlobalOptions
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import ArgumentParser
|
import ArgumentParser
|
||||||
import CliClient
|
import CliClient
|
||||||
|
import CliDoc
|
||||||
import Dependencies
|
import Dependencies
|
||||||
|
|
||||||
struct GenerateConfigurationCommand: AsyncParsableCommand {
|
struct GenerateConfigurationCommand: AsyncParsableCommand {
|
||||||
@@ -9,18 +10,23 @@ struct GenerateConfigurationCommand: AsyncParsableCommand {
|
|||||||
static let configuration = CommandConfiguration(
|
static let configuration = CommandConfiguration(
|
||||||
commandName: commandName,
|
commandName: commandName,
|
||||||
abstract: createAbstract("Generate a local configuration file."),
|
abstract: createAbstract("Generate a local configuration file."),
|
||||||
discussion: """
|
discussion: Discussion {
|
||||||
|
VStack {
|
||||||
\("NOTE:".yellow) If a directory is not supplied then a configuration file will be created
|
Note {
|
||||||
|
"""
|
||||||
|
If a directory is not supplied then a configuration file will be created
|
||||||
at \("'~/.config/hpa-playbook/config'".yellow).
|
at \("'~/.config/hpa-playbook/config'".yellow).
|
||||||
|
"""
|
||||||
\("Example:".yellow)
|
}
|
||||||
|
VStack {
|
||||||
\("Create a directory and generate the configuration file.".green)
|
"EXAMPLE:".yellow.bold
|
||||||
$ mkdir -p ~/.config/hpa-playbook
|
"Create a directory and generate the configuration".green
|
||||||
$ hpa generate-config --path ~/.config/hpa-playbook
|
ShellCommand("mkdir -p ~/.config/hpa-playbook")
|
||||||
|
ShellCommand("hpa generate-config --path ~/.config/hpa-playbook")
|
||||||
"""
|
}
|
||||||
|
}
|
||||||
|
.separator(.newLine(count: 2))
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ struct UtilsCommand: AsyncParsableCommand {
|
|||||||
|
|
||||||
static let configuration = CommandConfiguration(
|
static let configuration = CommandConfiguration(
|
||||||
commandName: commandName,
|
commandName: commandName,
|
||||||
abstract: "\("Utility commands.".blue)",
|
abstract: createAbstract("Utility commands."),
|
||||||
discussion: """
|
discussion: """
|
||||||
These are commands that are generally only run on occasion / less frequently used.
|
These are commands that are generally only run on occasion / less frequently used.
|
||||||
""",
|
""",
|
||||||
subcommands: [
|
subcommands: [
|
||||||
CreateProjectTemplateCommand.self, GenerateConfigurationCommand.self
|
GenerateProjectTemplateCommand.self,
|
||||||
|
GenerateConfigurationCommand.self
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user