File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed
Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ Options:
5959 of the vulnerable paths.
6060
6161Gradle options:
62- --gradle- sub-project=<string>
62+ --sub-project=<string> (alias: --gradle-sub-project)
6363 For Gradle "multi project" configurations,
6464 test a specific sub-project.
6565 --all-sub-projects For "multi project" configurations, test all
Original file line number Diff line number Diff line change @@ -160,6 +160,9 @@ export function args(rawArgv: string[]): Args {
160160 'packages-folder' ,
161161 'severity-threshold' ,
162162 'strict-out-of-sync' ,
163+ 'all-sub-projects' ,
164+ 'sub-project' ,
165+ 'gradle-sub-project' ,
163166 ] ) {
164167 if ( argv [ dashedArg ] ) {
165168 const camelCased = dashToCamelCase ( dashedArg ) ;
@@ -168,6 +171,12 @@ export function args(rawArgv: string[]): Args {
168171 }
169172 }
170173
174+ // Alias
175+ if ( argv . gradleSubProject ) {
176+ argv . subProject = argv . gradleSubProject ;
177+ delete argv . gradleSubProject ;
178+ }
179+
171180 if ( argv . insecure ) {
172181 global . ignoreUnknownCA = true ;
173182 }
Original file line number Diff line number Diff line change @@ -50,6 +50,31 @@ test('test --insecure', function(t) {
5050 '--insecure' ,
5151 ] ;
5252 var result = args ( cliArgs ) ;
53- t . equal ( global . ignoreUnknownCA , true , 'ignoreUnknownCA true' ) ;
53+ t . equal ( global . ignoreUnknownCA , true , 'ignoreUnknownCA true' )
54+ t . end ( ) ;
55+ } ) ;
56+
57+
58+ test ( 'test command line test --all-sub-projects' , function ( t ) {
59+ t . plan ( 1 ) ;
60+ var cliArgs = [ '/Users/dror/.nvm/versions/node/v6.9.2/bin/node' ,
61+ '/Users/dror/work/snyk/snyk-internal/cli' ,
62+ 'test' ,
63+ '--all-sub-projects' ,
64+ ] ;
65+ var result = args ( cliArgs ) ;
66+ t . ok ( result . options . allSubProjects ) ;
67+ t . end ( ) ;
68+ } ) ;
69+
70+ test ( 'test command line test --gradle-sub-project=foo' , function ( t ) {
71+ t . plan ( 1 ) ;
72+ var cliArgs = [ '/Users/dror/.nvm/versions/node/v6.9.2/bin/node' ,
73+ '/Users/dror/work/snyk/snyk-internal/cli' ,
74+ 'test' ,
75+ '--gradle-sub-project=foo' ,
76+ ] ;
77+ var result = args ( cliArgs ) ;
78+ t . equal ( result . options . subProject , 'foo' ) ;
5479 t . end ( ) ;
5580} ) ;
You can’t perform that action at this time.
0 commit comments