21
21
// See the License for the specific language governing permissions and
22
22
// limitations under the License.
23
23
//
24
- // last saved: <2018-November-26 16:16:58 >
24
+ // last saved: <2018-November-26 16:22:46 >
25
25
26
26
var async = require ( 'async' ) ,
27
27
edgejs = require ( 'apigee-edge-js' ) ,
@@ -30,11 +30,12 @@ var async = require('async'),
30
30
sprintf = require ( 'sprintf-js' ) . sprintf ,
31
31
Getopt = require ( 'node-getopt' ) ,
32
32
merge = require ( 'merge' ) ,
33
- version = '20180619-0825 ' ,
33
+ version = '20181126-1621 ' ,
34
34
gRegexp ,
35
35
getopt = new Getopt ( common . commonOptions . concat ( [
36
36
[ 'J' , 'jar=ARG' , 'Optional. JAR name to find. Default: search for all JavaCallout policies.' ] ,
37
- [ 'R' , 'regexp' , 'Optional. Treat the -J option as a regexp. Default: perform string match.' ]
37
+ [ 'R' , 'regexp' , 'Optional. Treat the -J option as a regexp. Default: perform string match.' ] ,
38
+ [ 'L' , 'latestrevisionnumber' , 'Optional. only look in the latest revision number for each proxy.' ]
38
39
] ) ) . bindHelp ( ) ;
39
40
40
41
// ========================================================
@@ -132,6 +133,10 @@ function analyzeOneProxy(org) {
132
133
return function ( proxyName , callback ) {
133
134
org . proxies . get ( { name : proxyName } , function ( e , result ) {
134
135
handleError ( e ) ;
136
+ if ( opt . options . latestrevisionnumber ) {
137
+ result . revision . sort ( ) ;
138
+ result . revision = [ result . revision . pop ( ) ] ;
139
+ }
135
140
async . mapSeries ( result . revision , getOneRevision ( org , proxyName ) , doneAllRevisions ( proxyName , callback ) ) ;
136
141
} ) ;
137
142
} ;
0 commit comments