File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -707,6 +707,22 @@ impl Toml {
707
707
}
708
708
}
709
709
710
+ #[ derive( Parser ) ]
711
+ struct Show {
712
+ #[ clap( long) ]
713
+ /// Displays the location of the cache directory
714
+ cache_directory : bool ,
715
+ }
716
+
717
+ impl Show {
718
+ fn run ( self ) {
719
+ if self . cache_directory {
720
+ log:: info!( "cache_directory: " ) ;
721
+ println ! ( "{}" , cache_dir( ) . display( ) ) ;
722
+ }
723
+ }
724
+ }
725
+
710
726
#[ derive( Subcommand ) ]
711
727
enum Command {
712
728
/// Install rust-gpu compiler artifacts.
@@ -719,6 +735,9 @@ enum Command {
719
735
/// found in the given toml file.
720
736
Toml ( Toml ) ,
721
737
738
+ /// Show some useful values.
739
+ Show ( Show ) ,
740
+
722
741
/// A hidden command that can be used to recursively print out all the subcommand help messages:
723
742
/// `cargo gpu dump-usage`
724
743
/// Useful for updating the README.
@@ -763,6 +782,7 @@ fn main() {
763
782
}
764
783
Command :: Build ( mut build) => build. run ( ) ,
765
784
Command :: Toml ( toml) => toml. run ( ) ,
785
+ Command :: Show ( show) => show. run ( ) ,
766
786
Command :: DumpUsage => dump_full_usage_for_readme ( ) ,
767
787
}
768
788
}
You can’t perform that action at this time.
0 commit comments