[][src]Trait mhgit::CommandOptions

pub trait CommandOptions {
    type Output;
    fn git_args(&self) -> Vec<&str>;
fn parse_output(&self, out: &str) -> Result<Self::Output, Error>; fn run(&self, repo: &Repository) -> Result<Self::Output, Error> { ... } }

Trait implemented by all command option struct (CommitOptions, PushOptions, etc.)

Associated Types

type Output

Loading content...

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.

Loading content...

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)?;
Loading content...

Implementors

impl CommandOptions for AddOptions[src]

type Output = ()

impl CommandOptions for CommitOptions[src]

type Output = ()

impl CommandOptions for NotesOptions[src]

type Output = ()

impl CommandOptions for PullOptions[src]

type Output = ()

impl CommandOptions for PushOptions[src]

type Output = ()

impl CommandOptions for RemoteOptions[src]

type Output = ()

impl CommandOptions for TagOptions[src]

type Output = ()

Loading content...