|
3 | 3 |
|
4 | 4 | use crate::{ |
5 | 5 | cargo_cli::{CargoCli, CargoOptions}, |
| 6 | + mangen::install_man, |
6 | 7 | output::{OutputContext, OutputOpts, OutputWriter}, |
7 | 8 | reuse_build::{make_path_mapper, ArchiveFormatOpt, ReuseBuildOpts}, |
8 | 9 | ExpectedError, Result, ReuseBuildKind, |
@@ -55,14 +56,20 @@ impl CargoNextestApp { |
55 | 56 | } |
56 | 57 |
|
57 | 58 | #[derive(Debug, Subcommand)] |
58 | | -enum NextestSubcommand { |
| 59 | +pub(crate) enum NextestSubcommand { |
59 | 60 | /// A next-generation test runner for Rust. <https://nexte.st> |
60 | 61 | Nextest(AppOpts), |
61 | 62 | } |
62 | 63 |
|
63 | | -#[derive(Debug, Args)] |
| 64 | +/// cargo-nextest is a next-generation test runner for Rust projects. |
| 65 | +/// |
| 66 | +/// Nextest runs tests in parallel and provides a rich set of features, such as partitioning test |
| 67 | +/// runs, JUnit output, and archiving and reusing builds. |
| 68 | +/// |
| 69 | +/// For the full documentation, see the nextest site at <https://nexte.st>. |
| 70 | +#[derive(Debug, Parser)] |
64 | 71 | #[clap(version)] |
65 | | -struct AppOpts { |
| 72 | +pub(crate) struct AppOpts { |
66 | 73 | /// Path to Cargo.toml |
67 | 74 | #[clap(long, global = true, value_name = "PATH")] |
68 | 75 | manifest_path: Option<Utf8PathBuf>, |
@@ -1018,6 +1025,12 @@ impl App { |
1018 | 1025 |
|
1019 | 1026 | #[derive(Debug, Subcommand)] |
1020 | 1027 | enum SelfCommand { |
| 1028 | + /// Install man pages for nextest. |
| 1029 | + InstallMan { |
| 1030 | + /// The output directory [default: <current-exe-path>/../man] |
| 1031 | + output_dir: Option<Utf8PathBuf>, |
| 1032 | + }, |
| 1033 | + |
1021 | 1034 | #[cfg_attr( |
1022 | 1035 | not(feature = "self-update"), |
1023 | 1036 | doc = "This version of nextest does not have self-update enabled\n\ |
@@ -1064,6 +1077,10 @@ impl SelfCommand { |
1064 | 1077 | let output = output.init(); |
1065 | 1078 |
|
1066 | 1079 | match self { |
| 1080 | + Self::InstallMan { output_dir } => { |
| 1081 | + install_man(output_dir)?; |
| 1082 | + Ok(0) |
| 1083 | + } |
1067 | 1084 | Self::Update { |
1068 | 1085 | version, |
1069 | 1086 | check, |
|
0 commit comments