Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use symbol_graph::ScanOutputs;
use tmpdir::TempDir;

#[derive(Parser, Debug, Clone)]
#[clap()]
#[command()]
struct OuterArgs {
#[command(subcommand)]
command: OuterCommand,
Expand All @@ -79,100 +79,100 @@ enum OuterCommand {
}

#[derive(Parser, Debug, Clone, Default)]
#[clap(version, about)]
#[command(version, about)]
struct Args {
/// Directory containing crate to analyze. Defaults to current working directory.
#[clap(long)]
#[arg(long)]
path: Option<PathBuf>,

/// Path to cackle.toml. Defaults to cackle.toml in the directory containing Cargo.toml.
#[clap(short, long)]
#[arg(short, long)]
cackle_path: Option<PathBuf>,

/// Print the mapping from paths to crate names. Useful for debugging.
#[clap(long, hide = true)]
#[arg(long, hide = true)]
print_path_to_crate_map: bool,

/// Promotes warnings (e.g. due to unused permissions) to errors.
#[clap(long)]
#[arg(long)]
fail_on_warnings: bool,

/// Ignore newer config versions.
#[clap(long)]
#[arg(long)]
ignore_newer_config_versions: bool,

/// Whether to use coloured output.
#[clap(long, alias = "color", default_value = "auto")]
#[arg(long, alias = "color", default_value = "auto")]
colour: colour::Colour,

/// Don't print anything on success.
#[clap(long)]
#[arg(long)]
quiet: bool,

/// Override the target used when compiling. e.g. "x86_64-unknown-linux-gnu".
#[clap(long)]
#[arg(long)]
target: Option<String>,

/// Override build profile.
#[clap(long)]
#[arg(long)]
profile: Option<String>,

/// Features to pass to cargo. Overrides common.features in config.
#[clap(long)]
#[arg(long)]
features: Option<String>,

/// Print how long various things take to run.
#[clap(long)]
#[arg(long)]
print_timing: bool,

/// Print additional information that's probably only useful for debugging.
#[clap(long)]
#[arg(long)]
debug: bool,

/// Output file for logs that might be useful for diagnosing problems.
#[clap(long)]
#[arg(long)]
log_file: Option<PathBuf>,

/// How detailed the logs should be.
#[clap(long, default_value = "info")]
#[arg(long, default_value = "info")]
log_level: logging::LevelFilter,

/// When specified, writes all requests into a subdirectory of the target directory. For
/// debugging use.
#[clap(long, hide = true)]
#[arg(long, hide = true)]
save_requests: bool,

/// Instead of running `cargo build`, replay requests saved by a previous run where
/// --write-requests was specified. For debugging use.
#[clap(long, hide = true)]
#[arg(long, hide = true)]
replay_requests: bool,

/// Temporary directory for Cackle to use. This is intended for testing purposes.
#[clap(long, hide = true)]
#[arg(long, hide = true)]
tmpdir: Option<PathBuf>,

/// What kind of user interface to use.
#[clap(long)]
#[arg(long)]
ui: Option<ui::Kind>,

/// Disable interactive UI.
#[clap(long, short)]
#[arg(long, short)]
no_ui: bool,

/// Automatically accept the default (first) fix for all problems.
/// When multiple fixes are available, always applies the most sensible option.
/// Useful for automated configuration generation.
#[clap(long)]
#[arg(long)]
auto_accept_fixes: bool,

/// Disable backtraces (may reduce peak memory consumption).
#[clap(long)]
#[arg(long)]
no_backtrace: bool,

// We may at some point allow this to be a short flag, but should probably wait a few releases.
// -p was previously accepted for --path.
/// Packages to build and analyse.
#[clap(long)]
#[arg(long)]
package: Vec<String>,

#[command(subcommand)]
Expand All @@ -190,13 +190,13 @@ enum Command {
/// Run `cargo run`, analysing whatever gets built.
Run(CargoOptions),

#[clap(hide = true, name = PROXY_BIN_ARG)]
#[command(hide = true, name = PROXY_BIN_ARG)]
ProxyBin(ProxyBinOptions),
}

#[derive(Parser, Debug, Clone)]
pub(crate) struct ProxyBinOptions {
#[clap(allow_hyphen_values = true)]
#[arg(allow_hyphen_values = true)]
remaining: Vec<String>,
}

Expand Down
2 changes: 1 addition & 1 deletion src/proxy/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub(crate) const PROFILE_NAME_ENV: &str = "CACKLE_BUILD_PROFILE";

#[derive(Parser, Debug, Clone)]
pub(crate) struct CargoOptions {
#[clap(allow_hyphen_values = true)]
#[arg(allow_hyphen_values = true)]
remaining: Vec<String>,
}

Expand Down
16 changes: 8 additions & 8 deletions src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@ pub enum OutputFormat {
#[derive(Parser, Debug, Clone)]
pub(crate) struct SummaryOptions {
/// Print summary by package.
#[clap(long)]
#[arg(long)]
by_package: bool,

/// Print summary by permission.
#[clap(long)]
#[arg(long)]
by_permission: bool,

/// Call out proc macros with other permissions.
#[clap(long)]
#[arg(long)]
impure_proc_macros: bool,

/// Print counts.
#[clap(long)]
#[arg(long)]
counts: bool,

/// Print all summary kinds. This is the default if no options are specified.
#[clap(long)]
#[arg(long)]
full: bool,

/// Whether to print headers for each summary section. This is forced on if more than one
/// summary is selected.
#[clap(long)]
#[arg(long)]
print_headers: bool,

/// The format of the output
#[clap(long, value_enum, action)]
#[clap(default_value_t = OutputFormat::Human)]
#[arg(long, value_enum)]
#[arg(default_value_t = OutputFormat::Human)]
output_format: OutputFormat,
}

Expand Down