add docstrings
This commit is contained in:
@@ -137,6 +137,9 @@ impl Group {
|
||||
})
|
||||
}
|
||||
|
||||
/// Add the new `packages` to the group file under the section `section_header`. If
|
||||
/// the section header does not yet exist, it is created. The packages are written
|
||||
/// in the provided order immediately after the header.
|
||||
pub(crate) fn save_packages(&self, section_header: &str, packages: &[Package]) -> Result<()> {
|
||||
let mut content = read_to_string(&self.path)
|
||||
.with_context(|| format!("reading existing file contents from {:?}", &self.path))?;
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*!
|
||||
This module reflects the relationship between groups, sections / backends and
|
||||
packages.
|
||||
|
||||
A ['Group'] contains one (strictly spoken zero, but this doesn't make sense) or
|
||||
more ['Section']s, which relate to individual backends. Each section contains
|
||||
one (strictly spoken zero) or more ['Package']s. On start-up `pacdef` will load
|
||||
all groups using ['Group::load'], which in turn will get all packages from all
|
||||
sections.
|
||||
*/
|
||||
mod group;
|
||||
mod package;
|
||||
mod section;
|
||||
|
||||
Reference in New Issue
Block a user