Skip to content

Commit 0298da9

Browse files
authored
Dev server rust (#52)
* feat: Implement file listing, permission changes, and search functionalities - Added `list_files` handler to list files in a directory with pagination and filtering options. - Introduced `change_permissions` handler to modify file permissions, supporting recursive changes. - Implemented `search_files`, `find_in_files`, and `replace_in_files` handlers for file operations based on name and content. - Created `FileInfo` struct to encapsulate file metadata for responses. - Updated router to include new file-related endpoints. - Enhanced path validation to ensure safe access to file system. - Added comprehensive tests for new functionalities, including permission changes and search operations. Signed-off-by: zzjin <tczzjin@gmail.com> * feat: Add version information and help option to server command Signed-off-by: zzjin <tczzjin@gmail.com> --------- Signed-off-by: zzjin <tczzjin@gmail.com>
1 parent 1578265 commit 0298da9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/server-rust/src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ use std::process;
1414
#[tokio::main]
1515
async fn main() {
1616
let args: Vec<String> = std::env::args().collect();
17+
let version = env!("CARGO_PKG_VERSION");
18+
19+
if args.iter().any(|arg| arg == "--version") {
20+
println!("devbox-sdk-server {}", version);
21+
process::exit(0);
22+
}
23+
1724
if args.iter().any(|arg| arg == "--help") {
18-
println!("devbox-server-rust");
25+
println!("devbox-sdk-server {}", version);
1926
println!("A lightweight server for code execution and file management.");
2027
println!();
2128
println!("USAGE:");
@@ -28,6 +35,7 @@ async fn main() {
2835
println!(" --token=<TOKEN> Sets the authentication token. [env: TOKEN / DEVBOX_JWT_SECRET] [default: a random token if not provided]");
2936
println!();
3037
println!(" --help Prints this help information.");
38+
println!(" --version Prints version information.");
3139
println!();
3240

3341
process::exit(0);

0 commit comments

Comments
 (0)