Skip to content

MarcoEidinger/Repeat

Repository files navigation

Repeat

Demo of using Swift Argument Parser and await/async

  1. Commit be39f86: I created a new package with swift package init --type executable --name RepeatCommandLineTool. This Swift package can be build and executed with swift run
  2. Commit 295881c: I added Swift Argument Parser (1.0.0) and Apple's Repeat example (sync processing). Build and run with swift run repeat --count 5 HelloWorld
  3. Commit 929075b: I used @main attribute and therefore had to rename main.swift file to avoid the error 'main' attribute cannot be used in a module that contains top-level code
  4. Commit 3909324: I added new code artifacts to convert the example to use async/await
  5. Commit 6be7396: I adopted Swift ArgumentParser 1.1.0 which has native support for async/await.

If you encounter the error dyld: Library not loaded: @rpath/libswift_Concurrency.dylib when running the command-line tool from within Xcode on a macOS version < 12.0 then you can enable the commented code in Package.swift (introduced with commit 26c67af)

About

Demo of using Swift Argument Parser and await/async

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages