1
- const _ = require ( 'lodash' ) ;
2
1
const Command = require ( '../../Command' ) ;
3
2
const createRoot = require ( '../root/create.cmd' ) ;
4
3
const Logic = require ( './annotation.logic' ) ;
@@ -12,7 +11,7 @@ const command = new Command({
12
11
title : 'create' ,
13
12
// weight: 50,
14
13
} ,
15
- builder : yargs => yargs
14
+ builder : ( yargs ) => yargs
16
15
. positional ( 'entity-type' , {
17
16
describe : 'Type of resource for annotation' ,
18
17
required : true ,
@@ -25,13 +24,18 @@ const command = new Command({
25
24
describe : 'Labels' ,
26
25
required : true ,
27
26
array : true ,
27
+ } ) . option ( 'display' , {
28
+ describe : 'annotation to display on build' ,
29
+ type : 'string' ,
28
30
} )
29
31
. example ( 'codefresh create annotation image 2dfacdaad466 coverage=75%' , 'Annotate entity with a single label' )
30
- . example ( 'codefresh create annotation image 2dfacdaad466 coverage=75% tests_passed=true' , 'Annotate entity with multiple labels' ) ,
32
+ . example ( 'codefresh create annotation image 2dfacdaad466 coverage=75% tests_passed=true' , 'Annotate entity with multiple labels' )
33
+ // eslint-disable-next-line max-len
34
+ . example ( 'codefresh create annotation image 2dfacdaad466 coverage=75% tests_passed=true --display coverage' , 'Annotate entity with multiple labels and display selection' ) ,
31
35
handler : async ( argv ) => {
32
- const { entityType, entityId, labels } = argv ;
36
+ const { entityType, entityId, labels, display } = argv ;
33
37
34
- await Logic . createAnnotations ( { entityId, entityType, labels } ) ;
38
+ await Logic . createAnnotations ( { entityId, entityType, labels, display } ) ;
35
39
console . log ( 'Annotations was created' ) ;
36
40
} ,
37
41
} ) ;
0 commit comments