counter with each repetition.") var includeCounter = false @Option(name: .shortAndLong, help: "The number of times to repeat 'phrase'.") var count: Int? = nil @Argument(help: "The phrase to repeat.") var phrase: String func run() async throws { let repeatCount = count ?? 2 for i in 1 ... repeatCount { if includeCounter { await someAsyncOperation() } else { print(phrase) } } } } https://github.com/apple/swift-argument-parser
counter with each repetition.") var includeCounter = false @Option(name: .shortAndLong, help: "The number of times to repeat 'phrase'.") var count: Int? = nil @Argument(help: "The phrase to repeat.") var phrase: String func run() async throws { let repeatCount = count ?? 2 for i in 1 ... repeatCount { if includeCounter { await someAsyncOperation() } else { print(phrase) } } } } https://github.com/apple/swift-argument-parser
counter with each repetition.") var includeCounter = false @Option(name: .shortAndLong, help: "The number of times to repeat 'phrase'.") var count: Int? = nil @Argument(help: "The phrase to repeat.") var phrase: String func run() async throws { let repeatCount = count ?? 2 for i in 1 ... repeatCount { if includeCounter { await someAsyncOperation() } else { print(phrase) } } } } https://github.com/apple/swift-argument-parser
"Hi! Set your token to use Chatty!") let validator = Validator( validate: { !$0.isEmpty }, failureString: "The OpenAI API token can not be empty ... " ) let token = text( question: "Enter your OpenAPI token", placeholder: "sk- ... ", validator: validator, isSecureEntry: true ) let keychain = Keychain(service: "dev.polpiella.chatty") keychain["openaitoken"] = token outro( text: "You're all set! You can now run " + "`chatty`".magenta.onWhite + " to converse ... " ) } }
"Hi! 👋 Set your token to use Chatty!") let validator = Validator( validate: { !$0.isEmpty }, failureString: "The OpenAI API token can not be empty ... " ) let token = text( question: "Enter your OpenAPI token", placeholder: "sk- ... ", validator: validator, isSecureEntry: true ) let keychain = Keychain(service: "dev.polpiella.chatty") keychain["openaitoken"] = token outro( text: "You're all set! You can now run " + "`chatty`".magenta.onWhite + " to converse ... " ) } }
"Hi! 👋 Set your token to use Chatty!") let validator = Validator( validate: { !$0.isEmpty }, failureString: "The OpenAI API token can not be empty ... " ) let token = text( question: "Enter your OpenAPI token", placeholder: "sk- ... ", validator: validator, isSecureEntry: true ) let keychain = Keychain(service: "dev.polpiella.chatty") keychain["openaitoken"] = token outro( text: "You're all set! You can now run " + "`chatty`".magenta.onWhite + " to converse ... " ) } }
"Hi! 👋 Set your token to use Chatty!") let validator = Validator( validate: { !$0.isEmpty }, failureString: "The OpenAI API token can not be empty ... " ) let token = text( question: "Enter your OpenAPI token", placeholder: "sk- ... ", validator: validator, isSecureEntry: true ) let keychain = Keychain(service: "dev.polpiella.chatty") keychain["openaitoken"] = token outro( text: "You're all set! You can now run " + "`chatty`".magenta.onWhite + " to converse ... " ) } }
"Hi! 👋 Set your token to use Chatty!") let validator = Validator( validate: { !$0.isEmpty }, failureString: "The OpenAI API token can not be empty ... " ) let token = text( question: "Enter your OpenAPI token", placeholder: "sk- ... ", validator: validator, isSecureEntry: true ) let keychain = Keychain(service: "dev.polpiella.chatty") keychain["openaitoken"] = token outro( text: "✅ You're all set! You can now run " + "`chatty`".magenta.onWhite + " to converse ... " ) } }