Struct Builder

Source
pub struct Builder { /* private fields */ }
Expand description

Build a ManualPage or several. The main command is sq itself. It can have multiple levels of subcommands, and we treat the leaves of the subcommand tree specially: every leaf gets a manual page, and every intermediate node gets an overview page. For example, “sq encrypt” is a leaf, as is “sq key generate”, but “sq key” is not.

Implementations§

Source§

impl Builder

Source

pub fn new( cmd: &mut Command, version: &str, extra_version: Option<&str>, ) -> Self

Return a builder to generate manual page.

cmd is a clap::Command that has been built to represent the sq command line interface. The manual pages are generated automatically from that information.

version is the bare version, which is usually obtained from env!("CARGO_PKG_VERSION").

If extra_version is Some, then the version is created version (extra_version).

For sequoia packages, this is usually: format!("sequoia-openpgp {}", sequoia_openpgp::VERSION).

Source

pub fn date(&mut self, date: &str) -> &mut Self

Set the date for the manual page. This is typically typeset in the center of the footer of the page.

Source

pub fn source(&mut self, source: &str) -> &mut Self

Set the source of the manual page. This is typically typeset on left of the footer of the page.

Source

pub fn manual(&mut self, manual: &str) -> &mut Self

Set the manual this page belongs to. This is typically typeset on the center of the header of the page.

Source

pub fn see_also<S>(&mut self, see_also: &[S]) -> &mut Self
where S: AsRef<str>,

Text that is added to the see also section.

For example:

For the full documentation see <https://book.sequoia-pgp.org>.
Source

pub fn binary(&self) -> String

Returns the name of the binary, e.g., sq, or sq-git.

Source

pub fn build(&self) -> Vec<ManualPage>

Build all manual pages for sq and one for each leaf subcommand.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.