feat: Adds generate-config as json file.
This commit is contained in:
@@ -11,8 +11,14 @@ struct GenerateConfigurationCommand: AsyncParsableCommand {
|
||||
abstract: "\("Generate a local configuration file.".blue)",
|
||||
discussion: """
|
||||
|
||||
If a directory is not supplied then a configuration file will be created
|
||||
at \("'~/.config/hpa-playbook/config'".yellow).
|
||||
\("NOTE:".yellow) 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
|
||||
|
||||
"""
|
||||
)
|
||||
@@ -24,6 +30,12 @@ struct GenerateConfigurationCommand: AsyncParsableCommand {
|
||||
)
|
||||
var path: String?
|
||||
|
||||
@Flag(
|
||||
name: .shortAndLong,
|
||||
help: "Generate a json file, instead of default env style"
|
||||
)
|
||||
var json: Bool = false
|
||||
|
||||
@OptionGroup var globals: BasicGlobalOptions
|
||||
|
||||
mutating func run() async throws {
|
||||
@@ -48,7 +60,7 @@ struct GenerateConfigurationCommand: AsyncParsableCommand {
|
||||
actualPath = "\(path)/config"
|
||||
}
|
||||
|
||||
try cliClient.createConfiguration(actualPath)
|
||||
try cliClient.createConfiguration(actualPath, json)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user