1- const _ = require ( 'lodash' ) ;
21const Command = require ( '../../Command' ) ;
32const createRoot = require ( '../root/create.cmd' ) ;
43const Logic = require ( './annotation.logic' ) ;
@@ -12,7 +11,7 @@ const command = new Command({
1211 title : 'create' ,
1312 // weight: 50,
1413 } ,
15- builder : yargs => yargs
14+ builder : ( yargs ) => yargs
1615 . positional ( 'entity-type' , {
1716 describe : 'Type of resource for annotation' ,
1817 required : true ,
@@ -25,13 +24,18 @@ const command = new Command({
2524 describe : 'Labels' ,
2625 required : true ,
2726 array : true ,
27+ } ) . option ( 'display' , {
28+ describe : 'annotation to display on build' ,
29+ type : 'string' ,
2830 } )
2931 . 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' ) ,
3135 handler : async ( argv ) => {
32- const { entityType, entityId, labels } = argv ;
36+ const { entityType, entityId, labels, display } = argv ;
3337
34- await Logic . createAnnotations ( { entityId, entityType, labels } ) ;
38+ await Logic . createAnnotations ( { entityId, entityType, labels, display } ) ;
3539 console . log ( 'Annotations was created' ) ;
3640 } ,
3741} ) ;
0 commit comments