feat: Working on command-line documentation.
Some checks failed
CI / Ubuntu (push) Has been cancelled

This commit is contained in:
2024-12-27 14:51:55 -05:00
parent 8d73287a60
commit 4420bd428a
28 changed files with 674 additions and 80 deletions

View File

@@ -9,6 +9,7 @@ import ShellClient
public extension DependencyValues {
/// The cli-client that runs the command line tool commands.
var cliClient: CliClient {
get { self[CliClient.self] }
set { self[CliClient.self] = newValue }
@@ -70,6 +71,7 @@ public struct CliClient: Sendable {
}
extension CliClient: DependencyKey {
public static let testValue: CliClient = Self()
public static func live(environment: [String: String]) -> Self {

View File

@@ -1,12 +1,12 @@
# Manual Plugins
There are two plugins that are included that can be ran manually, if the build tool plugin does not fit
your use case.
There are two plugins that are included that can be ran manually, if the build tool plugin does not
fit your use case.
## Generate Version
The `generate-version` plugin will create a `Version.swift` file in the given target. You can
run it by running the following command.
The `generate-version` plugin will create a `Version.swift` file in the given target. You can run it
by running the following command.
```bash
swift package --disable-sandbox \
@@ -32,16 +32,17 @@ swift package --disable-sandbox \
## Options
Both manual versions also allow the following options to customize the operation, the
options need to come after the plugin name.
Both manual versions also allow the following options to customize the operation, the options need
to come after the plugin name.
| Option | Description |
| ------ | ----------- |
| --dry-run | Do not write to any files, but describe where values would be written |
| --filename | Override the file name to be written in the target directory |
| --verbose | Increase the logging output |
| Option | Description |
| ---------- | --------------------------------------------------------------------- |
| --dry-run | Do not write to any files, but describe where values would be written |
| --filename | Override the file name to be written in the target directory |
| --verbose | Increase the logging output |
### Example with options
```bash
swift package \
--allow-writing-to-package-directory \

View File

@@ -1,4 +1,4 @@
# CliClient
# ``CliClient``
Derive a version for a command-line tool from git tags or a git sha.
@@ -9,8 +9,8 @@ Derive a version for a command-line tool from git tags or a git sha.
## Overview
This tool exposes several plugins that can be used to derive a version for a command line program at
build time or by manually running the plugin. The version is derived from git tags and falling back
to the branch and git sha if a tag is not set for the current worktree state.
build time or by manually running the plugin. The version is generally derived from git tags,
however it can be configured to run custom commands.
## Articles

View File

@@ -1,3 +0,0 @@
enum Constants {
static let defaultFileName = "Version.swift"
}