Skip to content
Merged
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
20 changes: 20 additions & 0 deletions crates/cargo-gpu/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,22 @@ impl Toml {
}
}

#[derive(Parser)]
struct Show {
#[clap(long)]
/// Displays the location of the cache directory
cache_directory: bool,
}

impl Show {
fn run(self) {
if self.cache_directory {
log::info!("cache_directory: ");
println!("{}", cache_dir().display());
}
}
}

#[derive(Subcommand)]
enum Command {
/// Install rust-gpu compiler artifacts.
Expand All @@ -719,6 +735,9 @@ enum Command {
/// found in the given toml file.
Toml(Toml),

/// Show some useful values.
Show(Show),

/// A hidden command that can be used to recursively print out all the subcommand help messages:
/// `cargo gpu dump-usage`
/// Useful for updating the README.
Expand Down Expand Up @@ -763,6 +782,7 @@ fn main() {
}
Command::Build(mut build) => build.run(),
Command::Toml(toml) => toml.run(),
Command::Show(show) => show.run(),
Command::DumpUsage => dump_full_usage_for_readme(),
}
}
Expand Down
Loading