@@ -11,10 +11,16 @@ fn cli() -> Command {
1111 . arg_required_else_help ( true )
1212 . allow_external_subcommands ( true )
1313 . subcommand ( Command :: new ( "connect" ) . about ( "Opens full session on remote" ) )
14+ . subcommand ( Command :: new ( "setup" ) . about ( "Create desktop files for installed Windows apps" ) )
1415 . subcommand (
1516 Command :: new ( "run" )
1617 . about ( "Runs a configured app or an executable on the remote" )
17- . arg ( arg ! ( NAME : "the name of the app/the path to the executable" ) ) ,
18+ . arg ( arg ! ( <NAME > "the name of the app/the path to the executable" ) )
19+ . arg (
20+ arg ! ( [ ARGS ] ... "Arguments to pass to the command" )
21+ . trailing_var_arg ( true )
22+ . allow_hyphen_values ( true ) ,
23+ ) ,
1824 )
1925 . subcommand (
2026 Command :: new ( "vm" )
@@ -55,6 +61,11 @@ fn main() -> Result<()> {
5561 backend. check_depends ( ) ?;
5662
5763 match matches. subcommand ( ) {
64+ Some ( ( "setup" , _) ) => {
65+ info ! ( "Running setup" ) ;
66+ todo ! ( )
67+ }
68+
5869 Some ( ( "connect" , _) ) => {
5970 info ! ( "Connecting to remote" ) ;
6071
@@ -65,9 +76,13 @@ fn main() -> Result<()> {
6576 Some ( ( "run" , sub_matches) ) => {
6677 info ! ( "Connecting to app on remote" ) ;
6778
79+ let args = sub_matches
80+ . get_many :: < String > ( "args" )
81+ . map_or ( Vec :: new ( ) , |args| args. map ( |v| v. to_owned ( ) ) . collect ( ) ) ;
82+
6883 match sub_matches. get_one :: < String > ( "name" ) {
6984 None => panic ! ( "App is required and should never be None here" ) ,
70- Some ( app) => client. run_app ( app) ,
85+ Some ( app) => client. run_app ( app. to_owned ( ) , args ) ,
7186 } ?;
7287
7388 Ok ( ( ) )
0 commit comments