elasticctl 0.7.4

Operate Elastic Security as code with a safety-first CLI for security engineers.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::cli::Cli;
use crate::cmd;
use crate::context::Context;
use elasticctl_core::Error;
use serde_json::Value;

// `doctor` builds its own context so it can report broken
// configuration. It includes permission warnings in its report.
pub(crate) async fn doctor(args: &Cli) -> Result<Value, Error> {
    cmd::doctor::run(&args.global).await
}

pub(crate) async fn info(args: &Cli) -> Result<Value, Error> {
    match Context::build(&args.global) {
        Ok(ctx) => cmd::info::run(&ctx).await,
        Err(e) => Err(e),
    }
}