feat 处理命令行输入.
This commit is contained in:
parent
9fcf3e18e1
commit
32fa27ef87
17
src/main.rs
17
src/main.rs
@ -1,3 +1,16 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
mod merge;
|
||||
|
||||
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
6
src/merge.rs
Normal file
@ -0,0 +1,6 @@
|
||||
use std::path::Path;
|
||||
use std::io::Result;
|
||||
|
||||
pub fn merge_video_from_path(path: &Path) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue
Block a user