[−][src]Trait mhgit::CommandOptions
Trait implemented by all command option struct (CommitOptions
, PushOptions
, etc.)
Associated Types
type Output
Required methods
fn git_args(&self) -> Vec<&str>
Return a vector of the arguments passed to git.
The vector contains at least one element, which is the name of the subcommand.
fn parse_output(&self, out: &str) -> Result<Self::Output, Error>
Parse the captured stdout into an appropriate rust type.
Provided methods
fn run(&self, repo: &Repository) -> Result<Self::Output, Error>
Run the command in the given git repository. Calling git and parsing and return the output of the command, if any.
If the git command returns error a GitError is returned.
use mhgit::{Repository, CommandOptions}; use mhgit::commands::AddOptions; let repo = Repository::new(); let _ = AddOptions::new() .all(true) .run(&repo)?;