Skip to content

Commit

Permalink
feat!: Add scanning for unmanaged files
Browse files Browse the repository at this point in the history
This completely changes the command line interface into a sub-command approach.
  • Loading branch information
VorpalBlade committed Mar 8, 2024
1 parent d5cfb0a commit 87a17f0
Show file tree
Hide file tree
Showing 10 changed files with 465 additions and 62 deletions.
195 changes: 173 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/paketkoll/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ log = "0.4.21"
os_info = { version = "3.7.0", default-features = false }
paketkoll_core = { version = "0.2.0", path = "../paketkoll_core" }
proc-exit = "2.0.1"
rayon = "1.9.0"

[build-dependencies]
clap = { version = "4.5.1", features = ["derive"] }
Expand Down
24 changes: 21 additions & 3 deletions crates/paketkoll/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::fmt::Display;

use clap::Parser;
use clap::{Parser, Subcommand};

#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
#[command(propagate_version = true)]
pub(crate) struct Cli {
/// Trust mtime (don't check checksum if it matches)
#[arg(long)]
Expand All @@ -14,8 +15,25 @@ pub(crate) struct Cli {
/// Which package manager backend to use
#[arg(short, long, default_value_t = Backend::Auto)]
pub(crate) backend: Backend,
/// Packages to check (default: all of them)
pub(crate) packages: Vec<String>,
/// Operation to perform
#[command(subcommand)]
pub(crate) command: Commands,
}

#[derive(Debug, Subcommand)]
pub(crate) enum Commands {
/// Check package files
Check {
/// Packages to check (default: all of them)
packages: Vec<String>,
},
/// Check package files and search for unexpected files
CheckUnexpected {
/// Extra paths to ignore (for unexpected file check only).
/// Globs are supported.
#[arg(long)]
ignore: Vec<String>,
},
}

/// Determine which package manager backend to use
Expand Down
Loading

0 comments on commit 87a17f0

Please sign in to comment.