@@ -51,10 +51,14 @@ pub struct Cli {
5151 /// Optional: Directly specify the leaderboard (e.g., "fp8")
5252 #[ arg( long) ]
5353 pub leaderboard : Option < String > ,
54-
54+
5555 /// Optional: Specify submission mode (test, benchmark, leaderboard, profile)
5656 #[ arg( long) ]
5757 pub mode : Option < String > ,
58+
59+ // Optional: Specify output file
60+ #[ arg( short, long) ]
61+ pub output : Option < String > ,
5862}
5963
6064#[ derive( Subcommand , Debug ) ]
@@ -88,6 +92,10 @@ enum Commands {
8892 /// Optional: Specify submission mode (test, benchmark, leaderboard, profile)
8993 #[ arg( long) ]
9094 mode : Option < String > ,
95+
96+ // Optional: Specify output file
97+ #[ arg( short, long) ]
98+ output : Option < String > ,
9199 } ,
92100}
93101
@@ -107,7 +115,13 @@ pub async fn execute(cli: Cli) -> Result<()> {
107115 } ;
108116 auth:: run_auth ( false , provider_str) . await
109117 }
110- Some ( Commands :: Submit { filepath, gpu, leaderboard, mode } ) => {
118+ Some ( Commands :: Submit {
119+ filepath,
120+ gpu,
121+ leaderboard,
122+ mode,
123+ output,
124+ } ) => {
111125 let config = load_config ( ) ?;
112126 let cli_id = config. cli_id . ok_or_else ( || {
113127 anyhow ! (
@@ -116,7 +130,7 @@ pub async fn execute(cli: Cli) -> Result<()> {
116130 . map_or_else( |_| "unknown path" . to_string( ) , |p| p. display( ) . to_string( ) )
117131 )
118132 } ) ?;
119-
133+
120134 // Use filepath from Submit command first, fallback to top-level filepath
121135 let final_filepath = filepath. or ( cli. filepath ) ;
122136 submit:: run_submit_tui (
@@ -125,6 +139,7 @@ pub async fn execute(cli: Cli) -> Result<()> {
125139 leaderboard, // From Submit command
126140 mode, // From Submit command
127141 cli_id,
142+ output, // From Submit command
128143 )
129144 . await
130145 }
@@ -136,7 +151,7 @@ pub async fn execute(cli: Cli) -> Result<()> {
136151 popcorn-cli submit [--gpu GPU] [--leaderboard LEADERBOARD] [--mode MODE] FILEPATH"
137152 ) ) ;
138153 }
139-
154+
140155 // Handle the case where only a filepath is provided (for backward compatibility)
141156 if let Some ( top_level_filepath) = cli. filepath {
142157 let config = load_config ( ) ?;
@@ -147,14 +162,15 @@ pub async fn execute(cli: Cli) -> Result<()> {
147162 . map_or_else( |_| "unknown path" . to_string( ) , |p| p. display( ) . to_string( ) )
148163 )
149164 } ) ?;
150-
165+
151166 // Run TUI with only filepath, no other options
152167 submit:: run_submit_tui (
153168 Some ( top_level_filepath) ,
154169 None , // No GPU option
155170 None , // No leaderboard option
156171 None , // No mode option
157172 cli_id,
173+ None , // No output option
158174 )
159175 . await
160176 } else {
0 commit comments