From bebda5b4dbff9bc8c4d040184beea23c7b805bde Mon Sep 17 00:00:00 2001 From: Rauhul Varma Date: Fri, 9 Sep 2022 14:08:44 -0700 Subject: [PATCH] review feedback --- Sources/ArgumentParser/Parsable Properties/Argument.swift | 4 ++-- Sources/ArgumentParser/Parsable Properties/Option.swift | 8 ++++---- .../HelpGenerationTests+AtArgument.swift | 2 +- .../HelpGenerationTests+AtOption.swift | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/ArgumentParser/Parsable Properties/Argument.swift b/Sources/ArgumentParser/Parsable Properties/Argument.swift index 409107873..0d44f9c5e 100644 --- a/Sources/ArgumentParser/Parsable Properties/Argument.swift +++ b/Sources/ArgumentParser/Parsable Properties/Argument.swift @@ -322,7 +322,7 @@ extension Argument { Optional @Arguments with default values should be declared as non-Optional. """) public init( - wrappedValue: Value, + wrappedValue: Optional, help: ArgumentHelp? = nil, completion: CompletionKind? = nil ) where T: ExpressibleByArgument, Value == Optional { @@ -403,7 +403,7 @@ extension Argument { Optional @Arguments with default values should be declared as non-Optional. """) public init( - wrappedValue: Value, + wrappedValue: Optional, help: ArgumentHelp? = nil, completion: CompletionKind? = nil, transform: @escaping (String) throws -> T diff --git a/Sources/ArgumentParser/Parsable Properties/Option.swift b/Sources/ArgumentParser/Parsable Properties/Option.swift index 93afc00fd..ea6751064 100644 --- a/Sources/ArgumentParser/Parsable Properties/Option.swift +++ b/Sources/ArgumentParser/Parsable Properties/Option.swift @@ -433,7 +433,7 @@ extension Option { Optional @Options with default values should be declared as non-Optional. """) public init( - wrappedValue: Value, + wrappedValue: Optional, name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, @@ -533,7 +533,7 @@ extension Option { Optional @Options with default values should be declared as non-Optional. """) public init( - wrappedValue: Value, + wrappedValue: Optional, name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, @@ -605,7 +605,7 @@ extension Option { /// - help: Information about how to use this option. /// - completion: Kind of completion provided to the user for this option. public init( - wrappedValue: Value, + wrappedValue: Array, name: NameSpecification = .long, parsing parsingStrategy: ArrayParsingStrategy = .singleValue, help: ArgumentHelp? = nil, @@ -678,7 +678,7 @@ extension Option { /// - transform: A closure that converts a string into this property's /// element type or throws an error. public init( - wrappedValue: Value, + wrappedValue: Array, name: NameSpecification = .long, parsing parsingStrategy: ArrayParsingStrategy = .singleValue, help: ArgumentHelp? = nil, diff --git a/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtArgument.swift b/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtArgument.swift index a939b1cdb..e34a7e255 100644 --- a/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtArgument.swift +++ b/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtArgument.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Argument Parser open source project // -// Copyright (c) 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2022 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information diff --git a/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtOption.swift b/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtOption.swift index 5e8b85419..a09b4a9a5 100644 --- a/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtOption.swift +++ b/Tests/ArgumentParserUnitTests/HelpGenerationTests+AtOption.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Argument Parser open source project // -// Copyright (c) 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2022 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information