cli.rs: Add documentation to functions

This commit is contained in:
Matthias Beyer 2015-12-29 16:45:14 +01:00
parent bdcfa34449
commit 0d6f2b9500

View file

@ -28,18 +28,32 @@ impl<'a> CliConfig<'a> {
} }
} }
/**
* Check whether the CLI says we should run verbose
*/
pub fn is_verbose(&self) -> bool { pub fn is_verbose(&self) -> bool {
self.cli_matches.is_present("verbose") || self.is_debugging() self.cli_matches.is_present("verbose") || self.is_debugging()
} }
/**
* Check whether the CLI says we should run in debugging
*/
pub fn is_debugging(&self) -> bool { pub fn is_debugging(&self) -> bool {
self.cli_matches.is_present("debug") self.cli_matches.is_present("debug")
} }
/**
* Get the runtime path the CLI configured
*/
pub fn get_rtp(&self) -> Option<String> { pub fn get_rtp(&self) -> Option<String> {
self.cli_matches.value_of("rtp").and_then(|s| Some(String::from(s))) self.cli_matches.value_of("rtp").and_then(|s| Some(String::from(s)))
} }
/**
* Get the store path the CLI configured
*
* TODO: Implement properly. Not working by now.
*/
pub fn store_path(&self) -> Option<String> { pub fn store_path(&self) -> Option<String> {
self.get_rtp().and_then(|rtp| { self.get_rtp().and_then(|rtp| {
self.cli_matches self.cli_matches