chore: cargo fmt
This commit is contained in:
		
							parent
							
								
									a0f0c20f03
								
							
						
					
					
						commit
						49cc76cf77
					
				| 
						 | 
				
			
			@ -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(())
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +1,8 @@
 | 
			
		|||
use aiken::{
 | 
			
		||||
    cmd::{
 | 
			
		||||
        Cmd,
 | 
			
		||||
use aiken::cmd::{
 | 
			
		||||
    blueprint::{self, address},
 | 
			
		||||
        build, check, docs, fmt, lsp, new,
 | 
			
		||||
    build, check, completion, docs, fmt, lsp, new,
 | 
			
		||||
    packages::{self, add},
 | 
			
		||||
        tx, uplc, completion,
 | 
			
		||||
    },
 | 
			
		||||
    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),
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue