File tree 4 files changed +40
-23
lines changed
4 files changed +40
-23
lines changed Original file line number Diff line number Diff line change 1
1
# codebase-stats-cli
2
- CLI wrapper around https://github.com/anton-107/codebase-stats-collector
2
+
3
+ CLI wrapper around https://github.com/anton-107/codebase-stats-collector
3
4
4
5
## Usage
6
+
7
+ ```
8
+ npm run cli -- knowledge-gaps <PATH TO GIT REPO> --ignoreFiles /path/to/ignored/folder
5
9
```
6
- npm run cli -- knowledge-gaps
7
- ```
Original file line number Diff line number Diff line change @@ -4,4 +4,3 @@ module.exports = {
4
4
testEnvironment : "node" ,
5
5
testPathIgnorePatterns : [ "<rootDir>/node_modules/" , "<rootDir>/dist/" ] ,
6
6
} ;
7
-
Original file line number Diff line number Diff line change 1
1
import { cli , command } from "cleye" ;
2
2
3
3
export class CommandLineInterface {
4
- constructor ( ) { }
5
- public run ( ) {
6
- cli ( {
7
- commands : [
8
- command (
9
- {
10
- name : "knowledge-gaps" ,
11
- parameters : [ "[prompt]" ] ,
12
- } ,
13
- async ( ) => {
14
- console . log ( "Calculating files with least number of contributors" ) ;
15
- } ,
16
- ) ,
17
- ] ,
18
- } ) ;
19
- }
20
- }
4
+ constructor ( ) { }
5
+ public run ( ) {
6
+ cli ( {
7
+ commands : [
8
+ command (
9
+ {
10
+ name : "knowledge-gaps" ,
11
+ parameters : [ "<path to repository>" ] ,
12
+ flags : {
13
+ ignoreFiles : {
14
+ type : String ,
15
+ description : "Which files to ignore in the output" ,
16
+ } ,
17
+ } ,
18
+ } ,
19
+ async ( argv ) => {
20
+ const repo = argv . _ . pathToRepository ;
21
+ console . log (
22
+ "Calculating files with least number of contributors" ,
23
+ repo ,
24
+ ) ;
25
+ if ( argv . flags . ignoreFiles ) {
26
+ console . log (
27
+ "will ignore the following files in the output: " ,
28
+ argv . flags . ignoreFiles ,
29
+ ) ;
30
+ }
31
+ } ,
32
+ ) ,
33
+ ] ,
34
+ } ) ;
35
+ }
36
+ }
Original file line number Diff line number Diff line change 1
- import { CommandLineInterface } from "./cli" ;
1
+ import { CommandLineInterface } from "./cli" ;
2
2
3
- new CommandLineInterface ( ) . run ( ) ;
3
+ new CommandLineInterface ( ) . run ( ) ;
You can’t perform that action at this time.
0 commit comments