diff --git a/README.md b/README.md index 3293cce..6d96309 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Upt is just an advanced alias, relying on the platform's package management tool ## Features -### Unified Interface +### Unified command interface Each operating system (OS) has its own package management tool, which requires different commands to complete the same operation. This can be inconvenient when switching between or trying new OSs. @@ -111,10 +111,7 @@ pacman -S vim # use pacman syntax +------------------------------------------------------+----------------------+ ``` -Some platforms may support multiple package management tools, and upt defaults to selecting them in the order listed in the table. -Of course, you can also specify the `UPT_TOOL` environment variable. - -For example, in Windows, `upt` will prioritize using `scoop`. If `scoop` is not available, it will use `choco`. If `choco` is also not available, it will use `winget`. If you set `UPT_TOOL=choco`, `choco` will be used even though `scoop` exists. +Some platforms may support multiple package management tools, and upt selects one of them in the order listed in the table. ## Install @@ -130,7 +127,7 @@ cargo install upt Download it from [GitHub Releases](https://github.com/sigoden/upt/releases), unzip and add aichat to your $PATH. -## CLI +## Usage ``` Usage: diff --git a/src/error.rs b/src/error.rs index e8cbfa2..6516ede 100644 --- a/src/error.rs +++ b/src/error.rs @@ -21,7 +21,10 @@ impl fmt::Display for UptError { NoVendor(v) => write!(f, "Vendor {} is not supported.", v), NotSupportOS => write!(f, "Your OS is not supported currently."), NotSupportTask => write!(f, "The task is not supported by your OS."), - NotFoundTool => write!(f, "No found package management tool."), + NotFoundTool => write!( + f, + "No found package management tool, use `$UPT_TOOL` to specify one." + ), InvalidSubcommand(v) => write!(f, "Invalid subcommand '{}'.", v), InvalidArgs(v) => write!(f, "Invalid arguments.\n\n{}", v), DisplyHelp(v) => write!(f, "{}", v), diff --git a/src/macros.rs b/src/macros.rs index 33baa24..7a095f0 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -63,7 +63,7 @@ macro_rules! tools { $( $os => vec![$($tool),+].into_iter().filter_map(|v| which_cmd(v)).collect(), )+ - _ => return Err(UptError::NotSupportOS), + _ => vec!["apt", "dnf", "pacman"], }; match $crate::utils::find_tool(&tools) { Some(tool) => $crate::vendor::init(&tool),