1- mod cmd;
2- mod parser;
3- mod sandbox;
4-
5- #[ cfg( any( target_os = "linux" , target_os = "macos" ) ) ]
6- mod daemon;
7-
8- #[ cfg( any( target_os = "linux" , target_os = "macos" ) ) ]
9- mod fuse;
10-
11- #[ cfg( target_os = "macos" ) ]
12- mod nfs;
13-
141use clap:: { CommandFactory , Parser } ;
152use clap_complete:: CompleteEnv ;
163
17- use crate :: {
18- cmd:: completions:: handle_completions,
4+ use agentfs:: {
5+ cmd:: { self , completions:: handle_completions} ,
6+ get_runtime,
197 parser:: { Args , Command , FsCommand } ,
208} ;
219
@@ -27,7 +15,7 @@ fn main() {
2715
2816 match args. command {
2917 Command :: Init { id, force, base } => {
30- let rt = tokio :: runtime :: Runtime :: new ( ) . expect ( "Failed to create tokio runtime" ) ;
18+ let rt = get_runtime ( ) ;
3119 if let Err ( e) = rt. block_on ( cmd:: init:: init_database ( id, force, base) ) {
3220 eprintln ! ( "Error: {}" , e) ;
3321 std:: process:: exit ( 1 ) ;
@@ -41,7 +29,7 @@ fn main() {
4129 command,
4230 args,
4331 } => {
44- let rt = tokio :: runtime :: Runtime :: new ( ) . expect ( "Failed to create tokio runtime" ) ;
32+ let rt = get_runtime ( ) ;
4533 if let Err ( e) = rt. block_on ( cmd:: handle_run_command (
4634 allow,
4735 no_default_allows,
@@ -77,14 +65,14 @@ fn main() {
7765 }
7866 }
7967 Command :: Diff { id_or_path } => {
80- let rt = tokio :: runtime :: Runtime :: new ( ) . expect ( "Failed to create tokio runtime" ) ;
68+ let rt = get_runtime ( ) ;
8169 if let Err ( e) = rt. block_on ( cmd:: fs:: diff_filesystem ( id_or_path) ) {
8270 eprintln ! ( "Error: {}" , e) ;
8371 std:: process:: exit ( 1 ) ;
8472 }
8573 }
8674 Command :: Fs { command } => {
87- let rt = tokio :: runtime :: Runtime :: new ( ) . expect ( "Failed to create tokio runtime" ) ;
75+ let rt = get_runtime ( ) ;
8876 match command {
8977 FsCommand :: Ls {
9078 id_or_path,
0 commit comments