@@ -62,6 +62,7 @@ public IEnumerable<ApplicationInsightsEntryFormat> Filter(object objectToFilter)
62
62
) ) ;
63
63
64
64
LogVerbosityForAllTopLevelCommand ( result , parseResult , topLevelCommandName , measurements ) ;
65
+ LogVulnerableOptionForPackageUpdateCommand ( result , parseResult , topLevelCommandName , measurements ) ;
65
66
66
67
foreach ( IParseResultLogRule rule in ParseResultLogRules )
67
68
{
@@ -138,6 +139,27 @@ TestCommandParser.ConfigurationOption ]
138
139
new AllowListToSendVerbSecondVerbFirstArgument ( [ "workload" , "tool" , "new" ] ) ,
139
140
] ;
140
141
142
+ private static void LogVulnerableOptionForPackageUpdateCommand (
143
+ ICollection < ApplicationInsightsEntryFormat > result ,
144
+ ParseResult parseResult ,
145
+ string topLevelCommandName ,
146
+ Dictionary < string , double > measurements = null )
147
+ {
148
+ if ( topLevelCommandName == "package" && parseResult . CommandResult . Command != null && parseResult . CommandResult . Command . Name == "update" )
149
+ {
150
+ var hasVulnerableOption = parseResult . HasOption ( "--vulnerable" ) ;
151
+
152
+ result . Add ( new ApplicationInsightsEntryFormat (
153
+ "sublevelparser/command" ,
154
+ new Dictionary < string , string > ( )
155
+ {
156
+ { "verb" , "package update" } ,
157
+ { "vulnerable" , hasVulnerableOption . ToString ( ) }
158
+ } ,
159
+ measurements ) ) ;
160
+ }
161
+ }
162
+
141
163
private static void LogVerbosityForAllTopLevelCommand (
142
164
ICollection < ApplicationInsightsEntryFormat > result ,
143
165
ParseResult parseResult ,
0 commit comments