@@ -195,7 +195,7 @@ enum Commands {
195195 #[ arg( short, long) ]
196196 all : bool ,
197197 /// Maximum number of nodes to list
198- #[ arg( long = "node-limit" , short = 'n' , default_value = "256" ) ]
198+ #[ arg( long = "node-limit" , short = 'n' , alias = "limit" , default_value = "256" ) ]
199199 node_limit : i32 ,
200200 } ,
201201 /// Get directory tree
@@ -209,7 +209,7 @@ enum Commands {
209209 #[ arg( short, long) ]
210210 all : bool ,
211211 /// Maximum number of nodes to list
212- #[ arg( long = "node-limit" , short = 'n' , default_value = "256" ) ]
212+ #[ arg( long = "node-limit" , short = 'n' , alias = "limit" , default_value = "256" ) ]
213213 node_limit : i32 ,
214214 /// Maximum depth level to traverse (default: 3)
215215 #[ arg( short = 'L' , long = "level-limit" , default_value = "3" ) ]
@@ -265,8 +265,8 @@ enum Commands {
265265 #[ arg( short, long, default_value = "" ) ]
266266 uri : String ,
267267 /// Maximum number of results
268- #[ arg( short = 'n' , long, default_value = "10" ) ]
269- limit : i32 ,
268+ #[ arg( short = 'n' , long = "node-limit" , alias = "limit" , default_value = "10" ) ]
269+ node_limit : i32 ,
270270 /// Score threshold
271271 #[ arg( short, long) ]
272272 threshold : Option < f64 > ,
@@ -282,8 +282,8 @@ enum Commands {
282282 #[ arg( long) ]
283283 session_id : Option < String > ,
284284 /// Maximum number of results
285- #[ arg( short = 'n' , long, default_value = "10" ) ]
286- limit : i32 ,
285+ #[ arg( short = 'n' , long = "node-limit" , alias = "limit" , default_value = "10" ) ]
286+ node_limit : i32 ,
287287 /// Score threshold
288288 #[ arg( short, long) ]
289289 threshold : Option < f64 > ,
@@ -298,6 +298,9 @@ enum Commands {
298298 /// Case insensitive
299299 #[ arg( short, long) ]
300300 ignore_case : bool ,
301+ /// Maximum number of results
302+ #[ arg( short = 'n' , long = "node-limit" , alias = "limit" , default_value = "256" ) ]
303+ node_limit : i32 ,
301304 } ,
302305 /// Run file glob pattern search
303306 Glob {
@@ -562,15 +565,16 @@ async fn main() {
562565 Commands :: Read { uri } => handle_read ( uri, ctx) . await ,
563566 Commands :: Abstract { uri } => handle_abstract ( uri, ctx) . await ,
564567 Commands :: Overview { uri } => handle_overview ( uri, ctx) . await ,
565- Commands :: Find { query, uri, limit , threshold } => {
566- handle_find ( query, uri, limit , threshold, ctx) . await
568+ Commands :: Find { query, uri, node_limit , threshold } => {
569+ handle_find ( query, uri, node_limit , threshold, ctx) . await
567570 }
568- Commands :: Search { query, uri, session_id, limit , threshold } => {
569- handle_search ( query, uri, session_id, limit , threshold, ctx) . await
571+ Commands :: Search { query, uri, session_id, node_limit , threshold } => {
572+ handle_search ( query, uri, session_id, node_limit , threshold, ctx) . await
570573 }
571- Commands :: Grep { uri, pattern, ignore_case } => {
572- handle_grep ( uri, pattern, ignore_case, ctx) . await
574+ Commands :: Grep { uri, pattern, ignore_case, node_limit } => {
575+ handle_grep ( uri, pattern, ignore_case, node_limit , ctx) . await
573576 }
577+
574578 Commands :: Glob { pattern, uri } => {
575579 handle_glob ( pattern, uri, ctx) . await
576580 }
@@ -860,24 +864,24 @@ async fn handle_overview(uri: String, ctx: CliContext) -> Result<()> {
860864async fn handle_find (
861865 query : String ,
862866 uri : String ,
863- limit : i32 ,
867+ node_limit : i32 ,
864868 threshold : Option < f64 > ,
865869 ctx : CliContext ,
866870) -> Result < ( ) > {
867871 let client = ctx. get_client ( ) ;
868- commands:: search:: find ( & client, & query, & uri, limit , threshold, ctx. output_format , ctx. compact ) . await
872+ commands:: search:: find ( & client, & query, & uri, node_limit , threshold, ctx. output_format , ctx. compact ) . await
869873}
870874
871875async fn handle_search (
872876 query : String ,
873877 uri : String ,
874878 session_id : Option < String > ,
875- limit : i32 ,
879+ node_limit : i32 ,
876880 threshold : Option < f64 > ,
877881 ctx : CliContext ,
878882) -> Result < ( ) > {
879883 let client = ctx. get_client ( ) ;
880- commands:: search:: search ( & client, & query, & uri, session_id, limit , threshold, ctx. output_format , ctx. compact ) . await
884+ commands:: search:: search ( & client, & query, & uri, session_id, node_limit , threshold, ctx. output_format , ctx. compact ) . await
881885}
882886
883887/// Print command with specified parameters for debugging
@@ -938,11 +942,12 @@ async fn handle_stat(uri: String, ctx: CliContext) -> Result<()> {
938942 commands:: filesystem:: stat ( & client, & uri, ctx. output_format , ctx. compact ) . await
939943}
940944
941- async fn handle_grep ( uri : String , pattern : String , ignore_case : bool , ctx : CliContext ) -> Result < ( ) > {
945+ async fn handle_grep ( uri : String , pattern : String , ignore_case : bool , node_limit : i32 , ctx : CliContext ) -> Result < ( ) > {
942946 let client = ctx. get_client ( ) ;
943- commands:: search:: grep ( & client, & uri, & pattern, ignore_case, ctx. output_format , ctx. compact ) . await
947+ commands:: search:: grep ( & client, & uri, & pattern, ignore_case, node_limit , ctx. output_format , ctx. compact ) . await
944948}
945949
950+
946951async fn handle_glob ( pattern : String , uri : String , ctx : CliContext ) -> Result < ( ) > {
947952 let client = ctx. get_client ( ) ;
948953 commands:: search:: glob ( & client, & pattern, & uri, ctx. output_format , ctx. compact ) . await
0 commit comments