@@ -69,6 +69,7 @@ sub show-docs(Str $path, :$section, :$no-pager) {
69
69
shell " $ * EXECUTABLE-NAME -I$ i --doc=SectionFilter $ path $ fmt-string | $ pager" ;
70
70
}
71
71
else {
72
+ say " launching '$ * EXECUTABLE-NAME --doc $ path $ fmt-string | $ pager '" if DEBUG;
72
73
shell " $ * EXECUTABLE-NAME --doc $ path $ fmt-string | $ pager" ;
73
74
}
74
75
}
@@ -88,22 +89,18 @@ multi sub MAIN() {
88
89
}
89
90
90
91
multi sub MAIN ($ docee , Bool : $ n ) {
91
- return MAIN($ docee , : f) if defined $ docee . index (' .' ) ;
92
+ return MAIN($ docee , : f, : $ n ) if defined $ docee . index (' .' ) ;
92
93
if INDEX. IO ~~ : e {
93
94
my % data = EVALFILE INDEX;
94
95
if % data {$ docee } {
95
96
my $ newdoc = % data {$ docee }[0 ][0 ];
96
- return MAIN($ newdoc );
97
+ return MAIN($ newdoc , : $ n );
97
98
}
98
99
}
99
- if $ n {
100
- show-docs(locate-module($ docee ), : no-pager)
101
- } else {
102
- show-docs(locate-module($ docee ));
103
- }
100
+ show-docs(locate-module($ docee ), : no-pager($ n ));
104
101
}
105
102
106
- multi sub MAIN ($ docee , Bool : $ f ! ) {
103
+ multi sub MAIN ($ docee , Bool : $ f ! , Bool : $ n ) {
107
104
my ($ package , $ method ) = $ docee . split (' .' );
108
105
if ! $ method {
109
106
my % hits ;
@@ -114,7 +111,7 @@ multi sub MAIN($docee, Bool :$f!) {
114
111
($ package , $ method ) = $ final-docee . split (' .' );
115
112
116
113
my $ m = locate-module($ package );
117
- show-docs($ m , : section($ method ));
114
+ show-docs($ m , : section($ method ), : no-pager( $ n ) );
118
115
} else {
119
116
say ' In order to use unqualified sub and method names like "p6doc -f say"' ;
120
117
say ' you will need to run "p6doc-index build" to build index.data.' ;
@@ -123,12 +120,12 @@ multi sub MAIN($docee, Bool :$f!) {
123
120
}
124
121
} else {
125
122
my $ m = locate-module($ package );
126
- show-docs($ m , : section($ method ));
123
+ show-docs($ m , : section($ method ), : no-pager( $ n ) );
127
124
}
128
125
}
129
126
130
- multi sub MAIN (Str $ file where $ file . IO ~~ : e) {
131
- show-docs($ file );
127
+ multi sub MAIN (Str $ file where $ file . IO ~~ : e, Bool : $ n ) {
128
+ show-docs($ file , : no-pager( $ n ) );
132
129
}
133
130
134
131
sub disambiguate-f-search ( $ docee , % data ) {
0 commit comments