{"repo":"apple/swift-argument-parser","free":true,"listed":false,"github":"https://github.com/apple/swift-argument-parser","clone":"git clone https://github.com/apple/swift-argument-parser.git","description":"Straightforward, type-safe argument parsing for Swift","language":"Swift","stars":3755,"topics":["cli","command-line","flag","option"],"license":"Apache-2.0","category":"cli-tools","readme_excerpt":"Swift Argument Parser Usage Begin by declaring a type that defines the information that you need to collect from the command line. Decorate each stored property with one of ArgumentParser 's property wrappers, and then declare conformance to ParsableCommand and add the @main attribute. (Note, for async renditions of run , conform to AsyncParsableCommand rather than ParsableCommand .) Finally, implement your command's logic in the run() method. The ArgumentParser library parses the command-line arguments, instantiates your command type, and then either executes your run() method or exits with a useful message. ArgumentParser uses your properties' names and type information, along with the details you provide using property wrappers, to supply useful error messages and detailed help: Documentation For guides, articles, and API documentation see the [library's documentation on the Web][docs] or in Xcode. - [ArgumentParser documentation][docs] - Getting Started with ArgumentParser - ParsableCommand documentation - AsyncParsableCommand documentation [docs]: https://swiftpackageindex.com/apple/swift-argument-parser/documentation/argumentparser Examples This repository includes a few examples of using the library: - repeat is the example shown above. - roll is a simple utility implemented as a straight-line script. - math is an annotated example of using nested commands and subcommands. - count-lines uses async / await code in its implementation. - default-as-flag demonstrates hybri","default_branch":null,"files":null,"tree":[],"storefront":"/r/apple","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/apple/swift-argument-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}