Struct package_bootstrap::Bootstrap
source · pub struct Bootstrap { /* private fields */ }
Expand description
a command installer
Implementations§
source§impl Bootstrap
impl Bootstrap
pub fn new<P: AsRef<OsStr>>(name: &str, cli: Command, outdir: P) -> Self
sourcepub fn completions(&self) -> Result<(), Box<dyn Error>>
pub fn completions(&self) -> Result<(), Box<dyn Error>>
Generates and installs shell completions for all supported shells into
dir
.
Examples
To install shell completions under /usr:
use package_bootstrap::Bootstrap;
fn main() -> Result<(), Box<dyn std::error::Error>> {
Bootstrap::new("foo", clap::Command::new("foo"), "/usr")
.completions()?;
Ok(())
}
To install into a staging directory for packaging purposes:
use package_bootstrap::Bootstrap;
fn main() -> Result<(), Box<dyn std::error::Error>> {
Bootstrap::new("foo", clap::Command::new("foo"), "staging/usr")
.completions()?;
Ok(())
}
pub fn install(&self, arch: Option<String>) -> Result<(), Box<dyn Error>>
Auto Trait Implementations§
impl !RefUnwindSafe for Bootstrap
impl Send for Bootstrap
impl Sync for Bootstrap
impl Unpin for Bootstrap
impl !UnwindSafe for Bootstrap
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more