@@ -209,6 +209,68 @@ For examples see `but rub --help`."
209209 } ,
210210}
211211
212+ impl Subcommands {
213+ pub fn to_metrics_command ( & self ) -> CommandName {
214+ use CommandName :: * ;
215+ match self {
216+ Subcommands :: Log => Log ,
217+ Subcommands :: Status { .. } => Status ,
218+ Subcommands :: Stf { .. } => Stf ,
219+ Subcommands :: Rub { .. } => Rub ,
220+ Subcommands :: Base ( base:: Platform { cmd } ) => match cmd {
221+ base:: Subcommands :: Update => BaseUpdate ,
222+ base:: Subcommands :: Check => BaseCheck ,
223+ } ,
224+ Subcommands :: Branch ( branch:: Platform { cmd } ) => match cmd {
225+ None | Some ( branch:: Subcommands :: List { .. } ) => BranchList ,
226+ Some ( branch:: Subcommands :: New { .. } ) => BranchNew ,
227+ Some ( branch:: Subcommands :: Delete { .. } ) => BranchDelete ,
228+ Some ( branch:: Subcommands :: Unapply { .. } ) => BranchUnapply ,
229+ Some ( branch:: Subcommands :: Apply { .. } ) => BranchApply ,
230+ Some ( branch:: Subcommands :: Show { .. } ) => BranchShow ,
231+ } ,
232+ Subcommands :: Worktree ( crate :: worktree:: Platform { cmd : _ } ) => Worktree ,
233+ Subcommands :: Mark { .. } => Mark ,
234+ Subcommands :: Unmark => Unmark ,
235+ Subcommands :: Gui => Gui ,
236+ Subcommands :: Commit { .. } => Commit ,
237+ Subcommands :: Push ( _) => Push ,
238+ Subcommands :: New { .. } => New ,
239+ Subcommands :: Describe { .. } => Describe ,
240+ Subcommands :: Oplog { .. } => Oplog ,
241+ Subcommands :: Restore { .. } => Restore ,
242+ Subcommands :: Undo => Undo ,
243+ Subcommands :: Snapshot { .. } => Snapshot ,
244+ Subcommands :: Claude ( claude:: Platform { cmd } ) => match cmd {
245+ claude:: Subcommands :: PreTool => ClaudePreTool ,
246+ claude:: Subcommands :: PostTool => ClaudePostTool ,
247+ claude:: Subcommands :: Stop => ClaudeStop ,
248+ claude:: Subcommands :: Last { .. }
249+ | claude:: Subcommands :: PermissionPromptMcp { .. } => Unknown ,
250+ } ,
251+ Subcommands :: Cursor ( cursor:: Platform { cmd } ) => match cmd {
252+ cursor:: Subcommands :: AfterEdit => CursorAfterEdit ,
253+ cursor:: Subcommands :: Stop { .. } => CursorStop ,
254+ } ,
255+ Subcommands :: Forge ( forge:: integration:: Platform { cmd } ) => match cmd {
256+ forge:: integration:: Subcommands :: Auth => ForgeAuth ,
257+ forge:: integration:: Subcommands :: Forget { .. } => ForgeForget ,
258+ forge:: integration:: Subcommands :: ListUsers => ForgeListUsers ,
259+ } ,
260+ Subcommands :: Review ( forge:: review:: Platform { cmd } ) => match cmd {
261+ forge:: review:: Subcommands :: Publish { .. } => PublishReview ,
262+ forge:: review:: Subcommands :: Template { .. } => ReviewTemplate ,
263+ } ,
264+ Subcommands :: Completions { .. } => Completions ,
265+ Subcommands :: Absorb { .. } => Absorb ,
266+ Subcommands :: Metrics { .. }
267+ | Subcommands :: Actions ( _)
268+ | Subcommands :: Mcp { .. }
269+ | Subcommands :: Init { .. } => Unknown ,
270+ }
271+ }
272+ }
273+
212274#[ derive( Debug , Clone , Copy , clap:: ValueEnum , Default ) ]
213275pub enum CommandName {
214276 Log ,
@@ -231,6 +293,7 @@ pub enum CommandName {
231293 BranchNew ,
232294 BranchDelete ,
233295 BranchList ,
296+ BranchShow ,
234297 BranchUnapply ,
235298 BranchApply ,
236299 ClaudePreTool ,
0 commit comments