Struct gitjournal::config::Config
[−]
[src]
pub struct Config { 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_prefix: bool, pub template_prefix: String, }
The configuration structure for git-journal.
Fields
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 tags in an array, e.g. "internal"
Enable or disable the output and accumulation of commit footers
show_prefix: bool
Show or hide the commit message prefix, e.g. JIRA-1234
template_prefix: String
Commit message template prefix which will be added during commit preparation
Methods
impl Config
[src]
fn new() -> Self
Constructs a new Config
with default values.
Examples
use gitjournal::Config; let config = Config::new();
fn save_default_config(&self, path: &str) -> Result<String, Error>
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.
fn load(&mut self, path: &str) -> Result<(), Error>
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.
fn is_default_config(&self) -> bool
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 Debug for Config
[src]
impl PartialEq for Config
[src]
fn eq(&self, __arg_0: &Config) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Config) -> bool
This method tests for !=
.