File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ var cmd = {
2222 describe : 'Show statistics of listed questions'
2323 } )
2424 . option ( 't' , core . filters . tag )
25+ . option ( 'x' , {
26+ alias : 'extra' ,
27+ type : 'boolean' ,
28+ default : false ,
29+ describe : 'Show extra details: category, companies, tags.'
30+ } )
2531 . positional ( 'keyword' , {
2632 type : 'string' ,
2733 default : '' ,
@@ -69,6 +75,26 @@ cmd.handler = function(argv) {
6975 problem . name ,
7076 h . prettyLevel ( sprintf ( '%-6s' , problem . level ) ) ,
7177 problem . percent ) ;
78+
79+ if ( argv . extra ) {
80+ var badges = [ problem . category ] ;
81+ badges = badges . concat ( problem . companies || [ ] ) ;
82+ badges = badges . concat ( problem . tags || [ ] ) ;
83+
84+ var buf = [ ] ;
85+ var len = 0 ;
86+ badges . forEach ( function ( x ) {
87+ if ( len + x . length + 3 >= 60 ) {
88+ log . printf ( '%12s%s' , ' ' , chalk . dim ( buf . join ( ' | ' ) ) ) ;
89+ buf = [ ] ;
90+ len = 0 ;
91+ }
92+ buf . push ( x ) ;
93+ len += x . length + 3 ;
94+ } ) ;
95+ if ( buf . length > 0 )
96+ log . printf ( '%12s%s' , ' ' , chalk . dim ( buf . join ( ' | ' ) ) ) ;
97+ }
7298 } ) ;
7399
74100 if ( argv . stat ) {
You can’t perform that action at this time.
0 commit comments