@@ -102,6 +102,7 @@ pub fn opts() -> Vec<getopts::OptGroup> {
102
102
optopt( "w" , "output-format" , "the output type to write" ,
103
103
"[html|json]" ) ,
104
104
optopt( "o" , "output" , "where to place the output" , "PATH" ) ,
105
+ optopt( "" , "crate-name" , "specify the name of this crate" , "NAME" ) ,
105
106
optmulti( "L" , "library-path" , "directory to add to crate search path" ,
106
107
"DIR" ) ,
107
108
optmulti( "" , "cfg" , "pass a --cfg to rustc" , "" ) ,
@@ -323,7 +324,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
323
324
324
325
let cr = Path :: new ( cratefile) ;
325
326
info ! ( "starting to run rustc" ) ;
326
- let ( krate, analysis) = std:: task:: try ( proc ( ) {
327
+ let ( mut krate, analysis) = std:: task:: try ( proc ( ) {
327
328
let cr = cr;
328
329
core:: run_core ( libs. move_iter ( ) . collect ( ) ,
329
330
cfgs,
@@ -333,6 +334,11 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
333
334
info ! ( "finished with rustc" ) ;
334
335
analysiskey. replace ( Some ( analysis) ) ;
335
336
337
+ match matches. opt_str ( "crate-name" ) {
338
+ Some ( name) => krate. name = name,
339
+ None => { }
340
+ }
341
+
336
342
// Process all of the crate attributes, extracting plugin metadata along
337
343
// with the passes which we are supposed to run.
338
344
match krate. module . get_ref ( ) . doc_list ( ) {
0 commit comments