Skip to content

Commit

Permalink
feat(amplify-xcode): add param label to clarify usage of parameters ref
Browse files Browse the repository at this point in the history
  • Loading branch information
diegocstn committed Mar 5, 2021
1 parent 1cf4e2d commit 4977270
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct CLICommandGenerateJSONSchema: ParsableCommand, CommandExecutable, CLIComm
abstract: "Generates a JSON description of the CLI and its commands"
)

@Option(name: "output-path", help: "Path to save the output of generated schema file", &parameters)
@Option(name: "output-path", help: "Path to save the output of generated schema file", updating: &parameters)
private var outputPath: String

var environment: AmplifyCommandEnvironment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct CLICommandImportConfig: ParsableCommand, CommandExecutable, CLICommandRep
abstract: CommandImportConfig.description
)

@Option(name: "path", help: "Project base path", &parameters)
@Option(name: "path", help: "Project base path", updating: &parameters)
private var path: String = Process().currentDirectoryPath

var environment: AmplifyCommandEnvironment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct CLICommandImportModels: ParsableCommand, CommandExecutable, CLICommandRep
abstract: CommandImportModels.description
)

@Option(name: "path", help: "Project base path", &parameters)
@Option(name: "path", help: "Project base path", updating: &parameters)
private var path: String = Process().currentDirectoryPath

var environment: AmplifyCommandEnvironment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import ArgumentParser
/// `Argument` has been left out on purpose as we'd rather use options and flags for clarity of use.
/// Also by providing these extra initializers we make parameter name explicit.
extension Option where Value: ExpressibleByArgument {
init(wrappedValue: Value, name: String, help: String, _ parameters: inout Set<CLICommandParameter>) {
init(wrappedValue: Value, name: String, help: String, updating parameters: inout Set<CLICommandParameter>) {
self.init(
wrappedValue: wrappedValue,
name: .customLong(name),
Expand All @@ -27,7 +27,7 @@ extension Option where Value: ExpressibleByArgument {
parameters.insert(.option(name: name, type: type, help: help))
}

init(name: String, help: String, _ parameters: inout Set<CLICommandParameter>) {
init(name: String, help: String, updating parameters: inout Set<CLICommandParameter>) {
self.init(
name: .customLong(name),
parsing: .next,
Expand All @@ -40,7 +40,7 @@ extension Option where Value: ExpressibleByArgument {
}

extension Flag where Value == Bool {
init(wrappedValue: Value, name: String, help: String, _ parameters: inout Set<CLICommandParameter>) {
init(wrappedValue: Value, name: String, help: String, updating parameters: inout Set<CLICommandParameter>) {
self.init(wrappedValue: wrappedValue, name: .customLong(name), help: ArgumentHelp(help))
let type = String(describing: Value.self)
parameters.insert(.flag(name: name, type: type, help: help))
Expand Down

0 comments on commit 4977270

Please sign in to comment.