|
1 | 1 | # LaunchAgent
|
2 | 2 |
|
3 |
| -![SwiftPM] ![Swift5.2] ![license] ![build] |
| 3 | +![SwiftPM] ![Swift5.2] ![license] ![build] ![coverage] |
4 | 4 |
|
5 | 5 | [SwiftPM]: https://img.shields.io/badge/SwiftPM-compatible-success.svg
|
6 | 6 | [swift]: https://developer.apple.com/swift/
|
7 | 7 | [Swift5.2]: https://img.shields.io/badge/swift-5.2-orange.svg?style=flat
|
8 | 8 | [spm]: https://swift.org/package-manager/
|
9 | 9 | [license]: https://img.shields.io/github/license/emorydunn/LaunchAgent.svg?style=flat
|
10 | 10 | [build]: https://github.com/emorydunn/LaunchAgent/workflows/Swift/badge.svg
|
| 11 | +[docs]: https://emorydunn.github.io/LaunchAgent/ |
| 12 | +[coverage]: https://emorydunn.github.io/LaunchAgent/badge.svg |
11 | 13 |
|
12 |
| -LaunchAgent provides an easy way to programatically create and maintain [`launchd`][launchd] agents and daemons without needing to manually build Property Lists. |
| 14 | +LaunchAgent provides an easy way to pragmatically create and maintain [`launchd`][launchd] agents and daemons without needing to manually build Property Lists. |
| 15 | + |
| 16 | +Take a look at the full [documentation][docs]. |
13 | 17 |
|
14 | 18 | [launchd]: http://www.launchd.info
|
15 | 19 |
|
16 | 20 | ## LaunchAgent
|
17 | 21 |
|
18 |
| -A LaunchAgent can be createdinstantiated with either an array of program arguments: |
| 22 | +A LaunchAgent can be created with either an array of program arguments: |
19 | 23 | ```swift
|
20 | 24 | LaunchAgent(label: "local.PythonServer", program: ["python", "-m", "SimpleHTTPServer", "8000"])
|
21 | 25 | ```
|
|
42 | 46 | } catch {
|
43 | 47 | print("Unexpected error:" error)
|
44 | 48 | }
|
45 |
| - |
46 | 49 | ```
|
47 | 50 |
|
48 | 51 | ### Using LaunchControl to read and write LaunchAgents
|
@@ -70,8 +73,8 @@ Some keys use their own type to encapsulate a complex dictionary value.
|
70 | 73 | |------------------|----------|-----------|-------|
|
71 | 74 | | Label | String | true | |
|
72 | 75 | | Disabled | String | true | |
|
73 |
| -| Program | String | true | Either `Program` or `ProgramArguments` can be set. | |
74 |
| -| ProgramArguments | [String] | true | Either `Program` or `ProgramArguments` can be set. | |
| 76 | +| Program | String | true | | |
| 77 | +| ProgramArguments | [String] | true | | |
75 | 78 | | EnableGlobbing | Bool | true | deprecated in macOS |
|
76 | 79 |
|
77 | 80 | ### Program
|
@@ -105,7 +108,7 @@ Some keys use their own type to encapsulate a complex dictionary value.
|
105 | 108 | | initGroups | Bool | true | |
|
106 | 109 | | rootDirectory | String | true | |
|
107 | 110 |
|
108 |
| -### Run Constriants |
| 111 | +### Run Constraints |
109 | 112 | | Key Name | Key type | Supported | Notes |
|
110 | 113 | |------------------------|----------|-----------|-------|
|
111 | 114 | | launchOnlyOnce | Bool | true | |
|
|
0 commit comments