Skip to content

Commit 4ac53a8

Browse files
authored
Update main.rs
1 parent e5aeca4 commit 4ac53a8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

hacker/src/main.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::process::Command;
55
use std::io::{self, Write};
66

77
#[derive(Parser)]
8-
#[command(name = "hacker", about = "A vibrant CLI tool for managing hacker tools, gaming, and system utilities", version = "1.5.0")]
8+
#[command(name = "hacker", about = "A vibrant CLI tool for managing hacker tools, gaming, and system utilities", version = "1.7.0")]
99
struct Cli {
1010
#[command(subcommand)]
1111
command: Commands,
@@ -75,6 +75,10 @@ enum Commands {
7575
#[command(subcommand)]
7676
plugin_command: PluginCommands,
7777
},
78+
/// Restart a service
79+
Restart {
80+
service: String,
81+
},
7882
}
7983

8084
fn main() {
@@ -169,5 +173,12 @@ fn main() {
169173
}
170174
}
171175
Commands::Plugin { plugin_command } => handle_plugin(plugin_command),
176+
Commands::Restart { service } => {
177+
if service == "pipewire" {
178+
run_command_with_spinner("systemctl", vec!["--user", "restart", "pipewire"], "Restarting pipewire");
179+
} else {
180+
println!("{}", format!("Unknown service: {}", service).red().bold().on_black());
181+
}
182+
}
172183
}
173184
}

0 commit comments

Comments
 (0)