1mod convert;
2mod lang;
3mod pathutil;
4mod pwd;
5mod usage;
6
7use colored::Colorize;
8use std::env::args;
9use usage::{show_usage_and_exit, UsageType};
10
11pub fn run() {
12 colored::control::set_override(true);
13 let args = &mut args();
14
15 match args.nth(1) {
16 Some(cmd) if cmd == "convert" => {
17 convert::exec(args.next());
18 }
19 Some(cmd) if cmd == "pwd" => {
20 pwd::exec();
21 }
22 Some(cmd) => {
23 eprintln!("Command {} is currently not supported.", cmd.bold());
24 eprintln!("We welcomes any Issue/PR! URL: https://github.com/AsPulse/wsl-dirutils");
25 show_usage_and_exit(UsageType::Root);
26 }
27 None => {
28 show_usage_and_exit(UsageType::Root);
29 }
30 }
31}