Skip to content

Commit fd4c3b6

Browse files
authored
Prepare for 1.0 release (#355)
1 parent ddd45aa commit fd4c3b6

File tree

4 files changed

+53
-44
lines changed

4 files changed

+53
-44
lines changed

CHANGELOG.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,30 @@
44
Add new items at the end of the relevant section under **Unreleased**.
55
-->
66

7-
This project follows semantic versioning. While still in major version `0`,
8-
source-stability is only guaranteed within minor versions (e.g. between
9-
`0.0.3` and `0.0.4`). If you want to guard against potentially source-breaking
10-
package updates, you can specify your package dependency using
11-
`.upToNextMinor(from: "0.5.0")` as the requirement.
12-
137
## [Unreleased]
148

159
*No changes yet.*
1610

1711
---
1812

13+
## [1.0.0] - 2021-09-10
14+
15+
The 1.0 release marks an important milestone —
16+
`ArgumentParser` is now source stable!
17+
18+
### Changes
19+
20+
- `ArgumentParser` now provides a DocC documentation catalog, so you
21+
can view rendered articles and symbol documentation directly within
22+
Xcode.
23+
24+
### Fixes
25+
26+
- Parsing works as expected for options with single-dash names that
27+
are declared using the `.upToNextOption` parsing strategy.
28+
29+
---
30+
1931
## [0.5.0] - 2021-09-02
2032

2133
### Additions
@@ -515,7 +527,8 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
515527

516528
<!-- Link references for releases -->
517529

518-
[Unreleased]: https://github.com/apple/swift-argument-parser/compare/0.5.0...HEAD
530+
[Unreleased]: https://github.com/apple/swift-argument-parser/compare/1.0.0...HEAD
531+
[1.0.0]: https://github.com/apple/swift-argument-parser/compare/0.5.0...1.0.0
519532
[0.5.0]: https://github.com/apple/swift-argument-parser/compare/0.4.4...0.5.0
520533
[0.4.4]: https://github.com/apple/swift-argument-parser/compare/0.4.3...0.4.4
521534
[0.4.3]: https://github.com/apple/swift-argument-parser/compare/0.4.2...0.4.3

Package@swift-5.5.swift

+5-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import PackageDescription
1414

15-
var package = Package(
15+
let package = Package(
1616
name: "swift-argument-parser",
1717
products: [
1818
.library(
@@ -60,17 +60,12 @@ var package = Package(
6060
name: "ArgumentParserUnitTests",
6161
dependencies: ["ArgumentParser", "ArgumentParserTestHelpers"],
6262
exclude: ["CMakeLists.txt"]),
63+
.testTarget(
64+
name: "ArgumentParserPackageManagerTests",
65+
dependencies: ["ArgumentParser", "ArgumentParserTestHelpers"],
66+
exclude: ["CMakeLists.txt"]),
6367
.testTarget(
6468
name: "ArgumentParserExampleTests",
6569
dependencies: ["ArgumentParserTestHelpers"]),
6670
]
6771
)
68-
69-
#if swift(>=5.2)
70-
// Skip if < 5.2 to avoid issue with nested type synthesized 'CodingKeys'
71-
package.targets.append(
72-
.testTarget(
73-
name: "ArgumentParserPackageManagerTests",
74-
dependencies: ["ArgumentParser", "ArgumentParserTestHelpers"],
75-
exclude: ["CMakeLists.txt"]))
76-
#endif

README.md

+27-22
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
Begin by declaring a type that defines the information
66
that you need to collect from the command line.
77
Decorate each stored property with one of `ArgumentParser`'s property wrappers,
8-
declare conformance to `ParsableCommand`,
9-
and implement your command's logic in the `run()` method.
8+
and then declare conformance to `ParsableCommand` and add the `@main` attribute.
9+
Finally, implement your command's logic in the `run()` method.
1010

1111
```swift
1212
import ArgumentParser
1313

14+
@main
1415
struct Repeat: ParsableCommand {
1516
@Flag(help: "Include a counter with each repetition.")
1617
var includeCounter = false
@@ -33,11 +34,8 @@ struct Repeat: ParsableCommand {
3334
}
3435
}
3536
}
36-
37-
Repeat.main()
3837
```
3938

40-
You kick off execution by calling your type's static `main()` method.
4139
The `ArgumentParser` library parses the command-line arguments,
4240
instantiates your command type, and then either executes your `run()` method
4341
or exits with a useful message.
@@ -53,6 +51,7 @@ hello
5351
hello
5452
$ repeat --count 3
5553
Error: Missing expected argument 'phrase'.
54+
Help: <phrase> The phrase to repeat.
5655
Usage: repeat [--count <count>] [--include-counter] <phrase>
5756
See 'repeat --help' for more information.
5857
$ repeat --help
@@ -67,7 +66,8 @@ OPTIONS:
6766
-h, --help Show help for this command.
6867
```
6968

70-
For more information and documentation about all supported options, see [the `Documentation` folder at the root of the repository](https://github.com/apple/swift-argument-parser/tree/main/Documentation).
69+
For more information and documentation about all supported options,
70+
see the library's documentation in Xcode.
7171

7272
## Examples
7373

@@ -82,35 +82,40 @@ You can also see examples of `ArgumentParser` adoption among Swift project tools
8282
- [`indexstore-db`](https://github.com/apple/indexstore-db/pull/72) is a simple utility with two commands.
8383
- [`swift-format`](https://github.com/apple/swift-format/pull/154) uses some advanced features, like custom option values and hidden flags.
8484

85-
## Adding `ArgumentParser` as a Dependency
85+
## Project Status
8686

87-
To use the `ArgumentParser` library in a SwiftPM project,
88-
add the following line to the dependencies in your `Package.swift` file:
87+
The Swift Argument Parser package is source stable;
88+
version numbers follow semantic versioning.
89+
Source breaking changes to public API can only land in a new major version.
8990

90-
```swift
91-
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.5.0"),
92-
```
91+
The public API of version 1.0 of the `swift-argument-parser` package
92+
consists of non-underscored declarations that are marked public in the `ArgumentParser` module.
93+
Interfaces that aren't part of the public API may continue to change in any release,
94+
including the exact wording and formatting of the autogenerated help and error messages,
95+
as well as the package’s examples, tests, utilities, and documentation.
9396

94-
Because `ArgumentParser` is under active development,
95-
source-stability is only guaranteed within minor versions (e.g. between `0.0.3` and `0.0.4`).
96-
If you don't want potentially source-breaking package updates,
97-
use this dependency specification instead:
97+
Future minor versions of the package may introduce changes to these rules as needed.
9898

99-
```swift
100-
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "0.5.0")),
101-
```
99+
We'd like this package to quickly embrace Swift language and toolchain improvements that are relevant to its mandate.
100+
Accordingly, from time to time,
101+
we expect that new versions of this package will require clients to upgrade to a more recent Swift toolchain release.
102+
Requiring a new Swift release will only require a minor version bump.
102103

103-
Finally, include `"ArgumentParser"` as a dependency for your executable target:
104+
## Adding `ArgumentParser` as a Dependency
105+
106+
To use the `ArgumentParser` library in a SwiftPM project,
107+
add it to the dependencies for your package and your command-line executable target:
104108

105109
```swift
106110
let package = Package(
107111
// name, platforms, products, etc.
108112
dependencies: [
109-
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.4.0"),
110113
// other dependencies
114+
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
111115
],
112116
targets: [
113-
.target(name: "<command-line-tool>", dependencies: [
117+
.executableTarget(name: "<command-line-tool>", dependencies: [
118+
// other dependencies
114119
.product(name: "ArgumentParser", package: "swift-argument-parser"),
115120
]),
116121
// other targets

Sources/ArgumentParser/Documentation.docc/Extensions/Flag.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
### Counted Flags
1717

18-
- ``init(name:help:)-87c7k``
18+
- ``init(name:help:)``
1919

2020
### Custom Enumerable Flags
2121

@@ -37,7 +37,3 @@
3737
### Deprecated APIs
3838

3939
- ``init()``
40-
- ``init(name:default:exclusivity:help:)``
41-
- ``init(name:help:)-5iirr``
42-
- ``init(name:exclusivity:help:)``
43-
- ``init(name:exclusivity:help:)``

0 commit comments

Comments
 (0)