feat 处理命令行输入.

This commit is contained in:
licsber 2024-09-29 09:13:39 +08:00
parent 9fcf3e18e1
commit 32fa27ef87
2 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,16 @@
fn main() { mod merge;
println!("Hello, world!");
use std::env;
use std::error::Error;
use std::io::Result;
use std::path::PathBuf;
fn main() -> Result<()> {
let args: Vec<String> = env::args().collect();
let merge_path = if args.len() > 1 {
PathBuf::from(args[1].as_str())
} else {
PathBuf::from(".")
};
merge::merge_video_from_path(&merge_path)
} }

6
src/merge.rs Normal file
View File

@ -0,0 +1,6 @@
use std::path::Path;
use std::io::Result;
pub fn merge_video_from_path(path: &Path) -> Result<()> {
Ok(())
}