[][src]Struct gitjournal::config::Config

pub struct Config {
    pub categories: Vec<String>,
    pub category_delimiters: Vec<String>,
    pub colored_output: bool,
    pub default_template: Option<String>,
    pub enable_debug: bool,
    pub excluded_commit_tags: Vec<String>,
    pub enable_footers: bool,
    pub show_commit_hash: bool,
    pub show_prefix: bool,
    pub sort_by: String,
    pub template_prefix: String,
}

The configuration structure for git-journal.

Fields

categories: Vec<String>

Specifies the available categories for the commit message

category_delimiters: Vec<String>

Set the characters where the categories are wrapped in

colored_output: bool

Set to false if the output should not be colored

default_template: Option<String>

Specifies the default template. Will be used for tag validation and printing.

enable_debug: bool

Show or hide the debug messages like [OKAY] ... or [INFO] ...

excluded_commit_tags: Vec<String>

Excluded tags in an array, e.g. "internal"

enable_footers: bool

Enable or disable the output and accumulation of commit footers

show_commit_hash: bool

Show or hide the commit hash for every entry

show_prefix: bool

Show or hide the commit message prefix, e.g. JIRA-1234

sort_by: String

Sort the commits during the output by "date" (default) or "name"

template_prefix: String

Commit message template prefix which will be added during commit preparation

Methods

impl Config
[src]

pub fn new() -> Self
[src]

Constructs a new Config with default values.

Examples

use gitjournal::Config;
let config = Config::new();

pub fn save_default_config(&self, path: &str) -> Result<String, Error>
[src]

Save the default configuration file in a certain path.

Examples

use gitjournal::Config;
Config::new()
    .save_default_config(".")
    .expect("Could not save config.");

Errors

When toml encoding or file creation failed.

pub fn load(&mut self, path: &str) -> Result<(), Error>
[src]

Load a configuration file from a certain path.

Examples

use gitjournal::Config;
Config::new().load(".").expect("Could not load config.");

Errors

When toml decoding or file opening failed.

pub fn is_default_config(&self) -> bool
[src]

Check if the configuration matches with the default one.

Examples

use gitjournal::Config;
assert_eq!(Config::new().is_default_config(), true);

Trait Implementations

impl Default for Config
[src]

impl PartialEq<Config> for Config
[src]

impl Clone for Config
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Config
[src]

impl Serialize for Config
[src]

impl<'de> Deserialize<'de> for Config
[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]