chore: cargo fmt

This commit is contained in:
Cainã Costa 2023-07-25 12:28:09 -03:00 committed by Lucas
parent a0f0c20f03
commit 49cc76cf77
2 changed files with 16 additions and 14 deletions

View File

@ -1,5 +1,5 @@
use clap::{Subcommand, Command}; use clap::{Command, Subcommand};
use clap_complete::{Shell, generate}; use clap_complete::{generate, Shell};
use crate::cmd::Cmd as MainCmd; use crate::cmd::Cmd as MainCmd;
@ -8,21 +8,26 @@ use crate::cmd::Cmd as MainCmd;
pub enum Cmd { pub enum Cmd {
Bash, Bash,
Zsh, Zsh,
Fish Fish,
} }
pub fn exec(sub_cmd: Cmd) -> miette::Result<()> { pub fn exec(sub_cmd: Cmd) -> miette::Result<()> {
let shell = match sub_cmd { let shell = match sub_cmd {
Cmd::Bash => Shell::Bash, Cmd::Bash => Shell::Bash,
Cmd::Zsh => Shell::Zsh, Cmd::Zsh => Shell::Zsh,
Cmd::Fish => Shell::Fish Cmd::Fish => Shell::Fish,
}; };
let cli = Command::new("aiken").disable_version_flag(true); let cli = Command::new("aiken").disable_version_flag(true);
let mut main = MainCmd::augment_subcommands(cli); let mut main = MainCmd::augment_subcommands(cli);
generate(shell, &mut main, "aiken".to_string(), &mut std::io::stdout()); generate(
shell,
&mut main,
"aiken".to_string(),
&mut std::io::stdout(),
);
Ok(()) Ok(())
} }

View File

@ -1,11 +1,8 @@
use aiken::{ use aiken::cmd::{
cmd::{ blueprint::{self, address},
Cmd, build, check, completion, docs, fmt, lsp, new,
blueprint::{self, address}, packages::{self, add},
build, check, docs, fmt, lsp, new, tx, uplc, Cmd,
packages::{self, add},
tx, uplc, completion,
},
}; };
use owo_colors::OwoColorize; use owo_colors::OwoColorize;
@ -26,7 +23,7 @@ fn main() -> miette::Result<()> {
Cmd::Lsp(args) => lsp::exec(args), Cmd::Lsp(args) => lsp::exec(args),
Cmd::Tx(sub_cmd) => tx::exec(sub_cmd), Cmd::Tx(sub_cmd) => tx::exec(sub_cmd),
Cmd::Uplc(sub_cmd) => uplc::exec(sub_cmd), Cmd::Uplc(sub_cmd) => uplc::exec(sub_cmd),
Cmd::Completion(sub_cmd) => completion::exec(sub_cmd) Cmd::Completion(sub_cmd) => completion::exec(sub_cmd),
} }
} }