Skip to content

Instantly share code, notes, and snippets.

@DavidPiper94
Last active October 21, 2022 04:56
Show Gist options
  • Save DavidPiper94/8051c76e04318083467bed9d7bbaa30d to your computer and use it in GitHub Desktop.
Save DavidPiper94/8051c76e04318083467bed9d7bbaa30d to your computer and use it in GitHub Desktop.
Example code for article about ArgumentParser - Input
// 1
@Option(name: [.customLong("file")], help: "The file path to write the note to.")
var filePath: String
// 2
@Argument(help: "The note to write to file.")
var note: String
// 3
@Flag(name: .shortAndLong, help: "Overrides existing file.")
var force = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment