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_complete::{Shell, generate};
use clap::{Command, Subcommand};
use clap_complete::{generate, Shell};
use crate::cmd::Cmd as MainCmd;
@ -8,21 +8,26 @@ use crate::cmd::Cmd as MainCmd;
pub enum Cmd {
Bash,
Zsh,
Fish
Fish,
}
pub fn exec(sub_cmd: Cmd) -> miette::Result<()> {
let shell = match sub_cmd {
Cmd::Bash => Shell::Bash,
Cmd::Zsh => Shell::Zsh,
Cmd::Fish => Shell::Fish
Cmd::Fish => Shell::Fish,
};
let cli = Command::new("aiken").disable_version_flag(true);
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(())
}

View File

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