diff --git a/Sources/hpa/UtilsCommands/CreateTemplateCommand.swift b/Sources/hpa/UtilsCommands/CreateTemplateCommand.swift index 7fb51d5..47beba9 100644 --- a/Sources/hpa/UtilsCommands/CreateTemplateCommand.swift +++ b/Sources/hpa/UtilsCommands/CreateTemplateCommand.swift @@ -1,14 +1,14 @@ import ArgumentParser -struct CreateProjectTemplateCommand: AsyncParsableCommand { +struct GenerateProjectTemplateCommand: AsyncParsableCommand { - static let commandName = "create-template" + static let commandName = "generate-template" static let configuration = CommandConfiguration.playbook( commandName: commandName, - abstract: "Create a home performance assesment project template.", + abstract: "Generate a home performance assesment project template.", 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 diff --git a/Sources/hpa/UtilsCommands/GenerateConfigCommand.swift b/Sources/hpa/UtilsCommands/GenerateConfigCommand.swift index f7fc403..038e846 100644 --- a/Sources/hpa/UtilsCommands/GenerateConfigCommand.swift +++ b/Sources/hpa/UtilsCommands/GenerateConfigCommand.swift @@ -1,5 +1,6 @@ import ArgumentParser import CliClient +import CliDoc import Dependencies struct GenerateConfigurationCommand: AsyncParsableCommand { @@ -9,18 +10,23 @@ struct GenerateConfigurationCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( commandName: commandName, abstract: createAbstract("Generate a local configuration file."), - discussion: """ - - \("NOTE:".yellow) If a directory is not supplied then a configuration file will be created + discussion: Discussion { + VStack { + Note { + """ + If a directory is not supplied then a configuration file will be created at \("'~/.config/hpa-playbook/config'".yellow). - - \("Example:".yellow) - - \("Create a directory and generate the configuration file.".green) - $ mkdir -p ~/.config/hpa-playbook - $ hpa generate-config --path ~/.config/hpa-playbook - - """ + """ + } + VStack { + "EXAMPLE:".yellow.bold + "Create a directory and generate the configuration".green + ShellCommand("mkdir -p ~/.config/hpa-playbook") + ShellCommand("hpa generate-config --path ~/.config/hpa-playbook") + } + } + .separator(.newLine(count: 2)) + } ) @Option( diff --git a/Sources/hpa/UtilsCommands/UtilsCommand.swift b/Sources/hpa/UtilsCommands/UtilsCommand.swift index 3e79de3..648c6a7 100644 --- a/Sources/hpa/UtilsCommands/UtilsCommand.swift +++ b/Sources/hpa/UtilsCommands/UtilsCommand.swift @@ -5,12 +5,13 @@ struct UtilsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( commandName: commandName, - abstract: "\("Utility commands.".blue)", + abstract: createAbstract("Utility commands."), discussion: """ These are commands that are generally only run on occasion / less frequently used. """, subcommands: [ - CreateProjectTemplateCommand.self, GenerateConfigurationCommand.self + GenerateProjectTemplateCommand.self, + GenerateConfigurationCommand.self ] )