sysroot-cleaner/src/args.rs
Matteo Settenvini 344e16cf0f
feat(list): add allow and blocklist handling
This uses the .gitignore format to identify
which files should be allowed / blocked.

The allowlist gets precedence over the blocklist
if both are specified.
2025-01-26 14:55:26 +01:00

32 lines
1 KiB
Rust

// SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
// SPDX-License-Identifier: EUPL-1.2
use std::path::PathBuf;
use clap::Parser;
/// A tool to clean up sysroots for Linux embedded devices to save storage space.
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Args {
/// Simulate operations without carrying them out
#[arg(short = 'n', long, default_value_t = false)]
pub dry_run: bool,
/// Instead of simply removing files, move them to the
/// given location, preserving their relative folder structure
#[arg(long)]
pub split_to: Option<PathBuf>,
/// An allowlist of files to keep, in .gitignore format.
/// Note: this will take precedence over all other removal decisions.
#[arg(long)]
pub allowlist: Option<PathBuf>,
/// A blocklist of files to remove, in .gitignore format.
#[arg(long)]
pub blocklist: Option<PathBuf>,
/// The location of the sysroot to clean up
pub sysroot_location: PathBuf,
}