Skip to content

Commit

Permalink
📝 mark internal use binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
cdstanford committed Aug 22, 2024
1 parent 9b845f9 commit 49ec460
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/bin/audit.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! The audit binary: Interactively audit side effects in a crate.
//!
//! See README for current usage information.

use cargo_scan::audit_file::*;
use cargo_scan::auditing::audit::start_audit;
use cargo_scan::auditing::info::Config;
Expand Down
9 changes: 9 additions & 0 deletions src/bin/audit_stats.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
This binary is intended for internal use.
The main supported binaries are `--bin scan` and `--bin audit`.
See README.md for usage instructions.
*/

use anyhow::{anyhow, Result};
use cargo_lock::{Lockfile, Package};
use clap::Parser;
Expand Down Expand Up @@ -388,6 +395,8 @@ fn dump_sinks(all_stats: &Vec<AuditingStats>) -> Result<()> {
Ok(())
}
fn main() -> Result<()> {
eprintln!("Warning: `--bin audit_stats` is intended for internal use. The primary supported binaries are `--bin scan` and `--bin audit`.");

cargo_scan::util::init_logging();
let args = Args::parse();
let mut all_stats = Vec::new();
Expand Down
9 changes: 9 additions & 0 deletions src/bin/chain.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
This binary is intended for internal use.
The main supported binaries are `--bin scan` and `--bin audit`.
See README.md for usage instructions.
*/

use cargo_scan::auditing::chain::{Command, CommandRunner, OuterArgs};
use clap::Parser;

Expand All @@ -11,6 +18,8 @@ struct Args {
}

fn main() {
eprintln!("Warning: `--bin chain` is not recommended. The primary supported binaries are `--bin scan` and `--bin audit`.");

cargo_scan::util::init_logging();
let args = Args::parse();

Expand Down
9 changes: 9 additions & 0 deletions src/bin/check_resolution.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
This binary is intended for internal use.
The main supported binaries are `--bin scan` and `--bin audit`.
See README.md for usage instructions.
*/

#![allow(unused_variables)]

use std::path::PathBuf;
Expand Down Expand Up @@ -26,6 +33,8 @@ struct Args {
}

pub fn main() -> Result<()> {
eprintln!("Warning: `--bin check_resolution` is intended for internal use. The primary supported binaries are `--bin scan` and `--bin audit`.");

cargo_scan::util::init_logging();
let args = Args::parse();

Expand Down
9 changes: 9 additions & 0 deletions src/bin/default_audit.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
This binary is intended for internal use.
The main supported binaries are `--bin scan` and `--bin audit`.
See README.md for usage instructions.
*/

use std::{collections::HashSet, path::PathBuf};

use cargo_scan::{audit_file::AuditFile, effect::EffectType};
Expand Down Expand Up @@ -66,6 +73,8 @@ fn runner(args: Args) -> Result<()> {
}

fn main() {
eprintln!("Warning: `--bin default_audit` is intended for internal use. The primary supported binaries are `--bin scan` and `--bin audit`.");

cargo_scan::util::init_logging();
let args = Args::parse();

Expand Down
7 changes: 4 additions & 3 deletions src/bin/scan.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! Run a scan for a single crate.
//! The scan binary: Scan a crate and print side effects to stdout in CSV format.
//!
//! Prints out potentially dangerous effects to stdout (one per line),
//! in CSV format,
//! followed by various metadata.
//! as well as metadata.
//!
//! See README for current usage information.

use cargo_scan::effect::EffectInstance;
use cargo_scan::scan_stats::{self, CrateStats};
Expand Down
7 changes: 6 additions & 1 deletion src/bin/scan_all.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! Run a scan for a list of crates in parallel.
//! The scan_all binary: Scan a set of crates in parallel.
//!
//! This binary is used in our test suites and experiments (see the Makefile);
//! however, it is not recommended to call it directly.
//!
//! See README for current usage information.

use cargo_scan::effect::EffectInstance;
use cargo_scan::scan_stats::{self, CrateStats};
Expand Down
9 changes: 9 additions & 0 deletions src/bin/stat.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
This binary is intended for internal use.
The main supported binaries are `--bin scan` and `--bin audit`.
See README.md for usage instructions.
*/

use std::fs::create_dir_all;
use std::{fs::remove_dir_all, path::PathBuf};

Expand Down Expand Up @@ -69,6 +76,8 @@ impl std::fmt::Display for PathType {
// TODO: Figure out who is responsible for clearing the audit path so we don't
// re-use audited policies.
fn main() -> Result<()> {
eprintln!("Warning: `--bin stat` is intended for internal use. The primary supported binaries are `--bin scan` and `--bin audit`.");

cargo_scan::util::init_logging();
let args = Args::parse();

Expand Down

0 comments on commit 49ec460

Please sign in to comment.