Skip to content

Commit

Permalink
chore: prepare for 2024 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackhr-arch committed Oct 7, 2024
1 parent 7aa144c commit b42f266
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/commands/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use super::CliCmds;

pub fn gen_complete(shell: Option<clap_complete::Shell>) {
use clap::CommandFactory;
let gen = if let Some(gen) = shell {
eprintln!("Target Shell: {gen}");
gen
let shell = if let Some(shell) = shell {
eprintln!("Target Shell: {shell}");
shell
} else {
match clap_complete::shells::Shell::from_env() {
Some(gen) => {
eprintln!("Current Shell: {gen}");
gen
Some(shell) => {
eprintln!("Current Shell: {shell}");
shell
}
None => {
eprintln!("Unable to determine what shell this is");
Expand All @@ -19,7 +19,7 @@ pub fn gen_complete(shell: Option<clap_complete::Shell>) {
}
};
clap_complete::generate(
gen,
shell,
&mut CliCmds::command(),
"clashtui",
&mut std::io::stdout(),
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![warn(clippy::all)]
#![deny(unsafe_code)]
#![warn(keyword_idents_2024)]
mod clash;
mod commands;
#[cfg(feature = "tui")]
Expand Down

0 comments on commit b42f266

Please sign in to comment.