From d18f3991cafc71e1aac854a1b033f5faa9a07cdb Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 7 Dec 2021 11:31:12 +0800 Subject: [PATCH] Fix docs for `new` and `init` commands in `maturin --help` --- Changelog.md | 2 ++ src/main.rs | 5 ++--- src/new_project.rs | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 5109ffd40..339f46e79 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +* Fix docs for `new` and `init` commands in `maturin --help` in [#734](https://github.com/PyO3/maturin/pull/734) + ## [0.12.4] - 2021-12-06 * Add a `maturin init` command as a companion to `maturin new` in [#719](https://github.com/PyO3/maturin/pull/719) diff --git a/src/main.rs b/src/main.rs index 738422680..199772436 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,11 +6,10 @@ use anyhow::{bail, Context, Result}; use cargo_metadata::MetadataCommand; use fs_err as fs; -use maturin::GenerateProjectOptions; use maturin::{ develop, init_project, new_project, source_distribution, write_dist_info, BridgeModel, - BuildOptions, CargoToml, Metadata21, PathWriter, PlatformTag, PyProjectToml, PythonInterpreter, - Target, + BuildOptions, CargoToml, GenerateProjectOptions, Metadata21, PathWriter, PlatformTag, + PyProjectToml, PythonInterpreter, Target, }; #[cfg(feature = "upload")] use maturin::{upload_ui, PublishOpt}; diff --git a/src/new_project.rs b/src/new_project.rs index 39f1ddb37..3c4e7be1e 100644 --- a/src/new_project.rs +++ b/src/new_project.rs @@ -89,8 +89,10 @@ impl<'a> ProjectGenerator<'a> { } } +// workaround for https://github.com/TeXitoi/structopt/issues/333#issuecomment-712265332 +#[cfg_attr(not(doc), allow(missing_docs))] +#[cfg_attr(doc, doc = "Options common to `maturin new` and `maturin init`.")] #[derive(Debug, StructOpt)] -/// Options common to `maturin new` and `maturin init`. pub struct GenerateProjectOptions { /// Set the resulting package name, defaults to the directory name #[structopt(long)]