@@ -16,6 +16,8 @@ pub struct Options {
16
16
flag_quiet : Option < bool > ,
17
17
flag_color : Option < String > ,
18
18
flag_package : Vec < String > ,
19
+ flag_lib : bool ,
20
+ flag_bin : Vec < String > ,
19
21
}
20
22
21
23
pub const USAGE : & ' static str = "
@@ -30,6 +32,8 @@ Options:
30
32
-p SPEC, --package SPEC ... Package to document
31
33
--no-deps Don't build documentation for dependencies
32
34
-j N, --jobs N The number of jobs to run in parallel
35
+ --lib Document only this package's library
36
+ --bin NAME Document only the specified binary
33
37
--release Build artifacts in release mode, with optimizations
34
38
--features FEATURES Space-separated list of features to also build
35
39
--no-default-features Do not build the `default` feature
@@ -55,6 +59,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
55
59
56
60
let root = try!( find_root_manifest_for_wd ( options. flag_manifest_path , config. cwd ( ) ) ) ;
57
61
62
+ let empty = Vec :: new ( ) ;
58
63
let doc_opts = ops:: DocOptions {
59
64
open_result : options. flag_open ,
60
65
compile_opts : ops:: CompileOptions {
@@ -65,7 +70,11 @@ pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
65
70
no_default_features : options. flag_no_default_features ,
66
71
spec : & options. flag_package ,
67
72
exec_engine : None ,
68
- filter : ops:: CompileFilter :: Everything ,
73
+ filter : ops:: CompileFilter :: new ( options. flag_lib ,
74
+ & options. flag_bin ,
75
+ & empty,
76
+ & empty,
77
+ & empty) ,
69
78
release : options. flag_release ,
70
79
mode : ops:: CompileMode :: Doc {
71
80
deps : !options. flag_no_deps ,
0 commit comments