You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a documentation catalog and edits the content to provide public
documentation for the Package Plugin API
resolves#8827
### Motivation:
The Package Plugin API is required when creating swift package manager
plugins, but doesn't have publicly hosted documentation today. This
resolves that by creating the documentation catalog, adding curation
(organization), and editing the documentation content to match.
### Modifications:
- creates a documentation catalog
- provides curation (extension) DocC pages to provide organization to
the module and to each of the public types in the module
- edits to the documentation comments to align stylistically with DocC
conventions.
### Result:
The potential to build a documentation archive for the Package Plugin
API.
Preview the contents of this PR using the command:
```
swift package --disable-sandbox preview-documentation --target PackagePlugin
```
---------
Co-authored-by: Bri Peticca <bripeticca@gmail.com>
/// A rudimentary helper for extracting options and flags from a string list representing command line arguments. The idea is to extract all known options and flags, leaving just the positional arguments. This does not handle well the case in which positional arguments (or option argument values) happen to have the same name as an option or a flag. It only handles the long `--<name>` form of options, but it does respect `--` as an indication that all remaining arguments are positional.
13
+
/// A rudimentary helper for extracting options and flags from a list of strings that represent command line arguments.
14
+
///
15
+
/// Create the extractor with the full command line arguments provided, then extract all known
16
+
/// options and flags, which leaves the positional arguments.
17
+
///
18
+
/// This does not handle the case where positional arguments (or optional argument values) have the same
19
+
/// name as an option or a flag. It only handles the long form of options, not short forms, for example: `--<name>`, not `-n`.
20
+
/// It respects an argument that consists of two hyphens (`--`) as an indication that all remaining arguments are positional.
14
21
publicstructArgumentExtractor{
15
22
privatevarargs:[String]
16
23
privateletliterals:[String]
17
24
18
-
/// Initializes a ArgumentExtractor with a list of strings from which to extract flags and options. If the list contains `--`, any arguments that follow it are considered to be literals.
25
+
/// Creates an argument extractor with a list of strings from which to extract flags and options.
26
+
///
27
+
/// If the list contains `--`, any arguments that follow it are considered positional arguments.
19
28
publicinit(_ arguments:[String]){
20
29
// Split the array on the first `--`, if there is one. Everything after that is a literal.
0 commit comments