style: format Cub TUI module

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-07 21:17:45 +01:00
parent 1349c8a0eb
commit b91b3f2e63
@@ -8,7 +8,10 @@ use termion::raw::IntoRawMode;
use termion::screen::IntoAlternateScreen;
const SHORTCUTS: &[(&str, &str)] = &[
("-S <pkg>", "Install a package from the official repo or BUR"),
(
"-S <pkg>",
"Install a package from the official repo or BUR",
),
("-Ss <query>", "Search the official repo and cached BUR"),
("-Si <pkg>", "Show AUR package information"),
("-Sy", "Refresh BUR cache and verify AUR metadata access"),
@@ -27,12 +30,24 @@ const COMMANDS: &[(&str, &str)] = &[
("search <query>", "Search official repo and BUR cache"),
("info <pkg>", "Query AUR metadata"),
("sync", "Refresh BUR cache and AUR sync stamp"),
("system-upgrade", "Sync first, then update installed packages"),
(
"system-upgrade",
"Sync first, then update installed packages",
),
("build <dir>", "Build and install a local recipe tree"),
("get <pkg>", "Copy a BUR recipe into the current directory"),
("get-aur <pkg>", "Convert an AUR PKGBUILD into ~/.cub/recipes"),
("inspect <target>", "Inspect a local RBPKGBUILD or package metadata"),
("import-aur <target>", "Convert an AUR PKGBUILD into the current directory"),
(
"get-aur <pkg>",
"Convert an AUR PKGBUILD into ~/.cub/recipes",
),
(
"inspect <target>",
"Inspect a local RBPKGBUILD or package metadata",
),
(
"import-aur <target>",
"Convert an AUR PKGBUILD into the current directory",
),
("update-all", "Update installed packages"),
("remove <pkg>", "Remove an installed package"),
("query-local", "List installed packages"),
@@ -56,15 +71,30 @@ pub fn run() -> io::Result<()> {
}
}
write!(screen, "{}{}{}", clear::All, cursor::Goto(1, 1), cursor::Show)?;
write!(
screen,
"{}{}{}",
clear::All,
cursor::Goto(1, 1),
cursor::Show
)?;
screen.flush()
}
fn render(screen: &mut impl Write) -> io::Result<()> {
write!(screen, "{}{}{}", clear::All, cursor::Goto(1, 1), cursor::Hide)?;
write!(
screen,
"{}{}{}",
clear::All,
cursor::Goto(1, 1),
cursor::Hide
)?;
writeln!(screen, "cub — Red Bear OS Package Builder")?;
writeln!(screen)?;
writeln!(screen, "Default TUI mode is active because no subcommand was provided.")?;
writeln!(
screen,
"Default TUI mode is active because no subcommand was provided."
)?;
writeln!(screen, "Run `cub --no-tui` to see clap help instead.")?;
writeln!(screen)?;
writeln!(screen, "Arch-style shortcuts")?;