@@ -2,6 +2,9 @@ import {Option, CommandRunner, SubCommand} from 'nest-commander';
22import { MinterApiService } from '../../services/minter-api/minter-api.service' ;
33import { JsonPatches } from "../../utils/JsonPatches" ;
44
5+ import { search } from 'jmespath'
6+ // import * as jmespath from 'jmespath'
7+
58@SubCommand ( {
69 name : 'candidate' ,
710 arguments : '<public_key>' ,
@@ -28,7 +31,8 @@ export class CandidateCommand extends CommandRunner {
2831 if ( options . patches ) {
2932 new JsonPatches ( ) . printPropertyNames ( result )
3033 } else if ( options . patch && options . patch . length > 0 ) {
31- out = result [ options . patch ]
34+ // out=result[options.patch]
35+ out = search ( result , options . patch )
3236 } else {
3337 out = result
3438 }
@@ -42,8 +46,6 @@ export class CandidateCommand extends CommandRunner {
4246 return Promise . resolve ( undefined ) ;
4347 }
4448
45-
46-
4749 @Option ( {
4850 flags : '--height [number]' ,
4951 name : 'Height' ,
@@ -75,7 +77,7 @@ export class CandidateCommand extends CommandRunner {
7577
7678 @Option ( {
7779 flags : '-p, --patch [string]' ,
78- description : 'path to config file ' ,
80+ description : 'path JMESPath format ' ,
7981 // defaultValue: 'status',
8082 } )
8183 parsePatch ( val : string ) : string {
0 commit comments