summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-01-18 10:23:42 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-18 14:19:39 +0100
commit9aa56fcb69e53aedc20973c5c6284d3e277f92fe (patch)
tree62cd4ba8b65a4251b2d033458e50382869cb178c /src
parent0a3c5e2931f261b4476b1ab716755a356252a423 (diff)
Add comments on subcommand implementations
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src')
-rw-r--r--src/commands/build.rs1
-rw-r--r--src/commands/db.rs1
-rw-r--r--src/commands/dependencies_of.rs1
-rw-r--r--src/commands/env_of.rs1
-rw-r--r--src/commands/find_pkg.rs1
-rw-r--r--src/commands/lint.rs1
-rw-r--r--src/commands/release.rs1
-rw-r--r--src/commands/source.rs1
-rw-r--r--src/commands/tree_of.rs1
-rw-r--r--src/commands/util.rs2
-rw-r--r--src/commands/versions_of.rs1
-rw-r--r--src/commands/what_depends.rs1
12 files changed, 13 insertions, 0 deletions
diff --git a/src/commands/build.rs b/src/commands/build.rs
index e7c20c7..d0c8150 100644
--- a/src/commands/build.rs
+++ b/src/commands/build.rs
@@ -47,6 +47,7 @@ use crate::util::EnvironmentVariableName;
use crate::util::docker::ImageName;
use crate::util::progress::ProgressBars;
+/// Implementation of the "build" subcommand
#[allow(clippy::too_many_arguments)]
pub async fn build(repo_root: &Path,
matches: &ArgMatches,
diff --git a/src/commands/db.rs b/src/commands/db.rs
index ec8386b..130f86f 100644
--- a/src/commands/db.rs
+++ b/src/commands/db.rs
@@ -33,6 +33,7 @@ use crate::log::LogItem;
use crate::package::Script;
use crate::schema;
+/// Implementation of the "db" subcommand
pub fn db(db_connection_config: DbConnectionConfig, config: &Configuration, matches: &ArgMatches) -> Result<()> {
match matches.subcommand() {
Some(("cli", matches)) => cli(db_connection_config, matches),
diff --git a/src/commands/dependencies_of.rs b/src/commands/dependencies_of.rs
index e79e118..4fb44ed 100644
--- a/src/commands/dependencies_of.rs
+++ b/src/commands/dependencies_of.rs
@@ -17,6 +17,7 @@ use crate::config::*;
use crate::package::PackageName;
use crate::repository::Repository;
+/// Implementation of the "dependencies_of" subcommand
pub async fn dependencies_of(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> {
use filters::filter::Filter;
diff --git a/src/commands/env_of.rs b/src/commands/env_of.rs
index cff36aa..965d97c 100644
--- a/src/commands/env_of.rs
+++ b/src/commands/env_of.rs
@@ -16,6 +16,7 @@ use crate::package::PackageName;
use crate::package::PackageVersionConstraint;
use crate::repository::Repository;
+/// Implementation of the "env_of" subcommand
pub async fn env_of(matches: &ArgMatches, repo: Repository) -> Result<()> {
use filters::filter::Filter;
use std::io::Write;
diff --git a/src/commands/find_pkg.rs b/src/commands/find_pkg.rs
index 867527f..48ad31c 100644
--- a/src/commands/find_pkg.rs
+++ b/src/commands/find_pkg.rs
@@ -19,6 +19,7 @@ use crate::config::Configuration;
use crate::package::PackageVersionConstraint;
use crate::repository::Repository;
+/// Implementation of the "find_pkg" subcommand
pub async fn find_pkg(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> {
use std::io::Write;
diff --git a/src/commands/lint.rs b/src/commands/lint.rs
index 077cbca..c7e7168 100644
--- a/src/commands/lint.rs
+++ b/src/commands/lint.rs
@@ -20,6 +20,7 @@ use crate::package::PackageName;
use crate::package::PackageVersionConstraint;
use crate::util::progress::ProgressBars;
+/// Implementation of the "lint" subcommand
pub async fn lint(repo_path: &Path, matches: &ArgMatches, progressbars: ProgressBars, config: &Configuration, repo: Repository) -> Result<()> {
let linter = crate::ui::find_linter_command(repo_path, config)?
.ok_or_else(|| anyhow!("No linter command found"))?;
diff --git a/src/commands/release.rs b/src/commands/release.rs
index 1f494ce..79a7d21 100644
--- a/src/commands/release.rs
+++ b/src/commands/release.rs
@@ -22,6 +22,7 @@ use crate::db::models as dbmodels;
use crate::config::Configuration;
use crate::db::DbConnectionConfig;
+/// Implementation of the "release" subcommand
pub async fn release(db_connection_config: DbConnectionConfig, config: &Configuration, matches: &ArgMatches) -> Result<()> {
if !(config.releases_directory().exists() && config.releases_directory().is_dir()) {
return Err(anyhow!("Release directory does not exist or does not point to directory: {}", config.releases_directory().display()))
diff --git a/src/commands/source.rs b/src/commands/source.rs
index 00a8233..27320b3 100644
--- a/src/commands/source.rs
+++ b/src/commands/source.rs
@@ -29,6 +29,7 @@ use crate::repository::Repository;
use crate::source::*;
use crate::util::progress::ProgressBars;
+/// Implementation of the "source" subcommand
pub async fn source(matches: &ArgMatches, config: &Configuration, repo: Repository, progressbars: ProgressBars) -> Result<()> {
match matches.subcommand() {
Some(("verify", matches)) => verify(matches, config, repo, progressbars).await,
diff --git a/src/commands/tree_of.rs b/src/commands/tree_of.rs
index d62e417..f8da1ca 100644
--- a/src/commands/tree_of.rs
+++ b/src/commands/tree_of.rs
@@ -19,6 +19,7 @@ use crate::repository::Repository;
use crate::package::Tree;
use crate::util::progress::ProgressBars;
+/// Implementation of the "tree_of" subcommand
pub async fn tree_of(matches: &ArgMatches, repo: Repository, progressbars: ProgressBars) -> Result<()> {
let pname = matches.value_of("package_name").map(String::from).map(PackageName::from);
let pvers = matches.value_of("package_version").map(String::from).map(PackageVersionConstraint::new).transpose()?;
diff --git a/src/commands/util.rs b/src/commands/util.rs
index ea5c4d3..155c631 100644
--- a/src/commands/util.rs
+++ b/src/commands/util.rs
@@ -22,11 +22,13 @@ use crate::package::PhaseName;
use crate::package::ScriptBuilder;
use crate::package::Shebang;
+/// Helper for getting a boolean value by name form the argument object
pub fn getbool(m: &ArgMatches, name: &str, cmp: &str) -> bool {
// unwrap is safe here because clap is configured with default values
m.values_of(name).unwrap().any(|v| v == cmp)
}
+/// Helper function to lint all packages in an interator
pub async fn lint_packages<'a, I>(iter: I, linter: &Path, config: &Configuration, bar: indicatif::ProgressBar) -> Result<()>
where I: Iterator<Item = &'a Package> + 'a
{
diff --git a/src/commands/versions_of.rs b/src/commands/versions_of.rs
index b1bafd7..cfe8c4c 100644
--- a/src/commands/versions_of.rs
+++ b/src/commands/versions_of.rs
@@ -16,6 +16,7 @@ use log::trace;
use crate::package::PackageName;
use crate::repository::Repository;
+/// Implementation of the "versions_of" subcommand
pub async fn versions_of(matches: &ArgMatches, repo: Repository) -> Result<()> {
use filters::filter::Filter;
use std::io::Write;
diff --git a/src/commands/what_depends.rs b/src/commands/what_depends.rs
index 12a0c32..5ac7def 100644
--- a/src/commands/what_depends.rs
+++ b/src/commands/what_depends.rs
@@ -19,6 +19,7 @@ use crate::config::*;
use crate::package::PackageName;
use crate::repository::Repository;
+/// Implementation of the "what_depends" subcommand
pub async fn what_depends(matches: &ArgMatches, config: &Configuration, repo: Repository) -> Result<()> {
use filters::failable::filter::FailableFilter;