feat: Make all-in-one options available at the top command level

pull/24376/head
Carol (Nichols || Goulding) 2022-04-28 12:30:59 -04:00
parent 7cadb0192b
commit 62a70d9705
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
2 changed files with 10 additions and 22 deletions

View File

@ -1,7 +1,7 @@
use snafu::{ResultExt, Snafu};
use trogging::cli::LoggingConfig;
mod all_in_one;
pub(crate) mod all_in_one;
mod compactor;
mod database;
mod ingester;

View File

@ -9,7 +9,10 @@
clippy::future_not_send
)]
use crate::commands::tracing::{init_logs_and_tracing, init_simple_logs, TroggingGuard};
use crate::commands::{
run::all_in_one,
tracing::{init_logs_and_tracing, init_simple_logs, TroggingGuard},
};
use dotenv::dotenv;
use influxdb_iox_client::connection::Builder;
use iox_time::{SystemProvider, TimeProvider};
@ -90,25 +93,6 @@ For example, a command such as the following shows all actions
"#
)]
struct Config {
/// Log filter short-hand.
///
/// Convenient way to set log severity level filter.
/// Overrides --log-filter / LOG_FILTER.
///
/// -v 'info'
///
/// -vv 'debug,hyper::proto::h1=info,h2=info'
///
/// -vvv 'trace,hyper::proto::h1=info,h2=info'
#[clap(
short = 'v',
long = "--verbose",
multiple_occurrences = true,
takes_value = false,
parse(from_occurrences)
)]
pub log_verbose_count: u8,
/// gRPC address of IOx server to connect to
#[clap(
short,
@ -140,6 +124,10 @@ struct Config {
#[clap(long)]
num_threads: Option<usize>,
/// Supports having all-in-one be the default command.
#[clap(flatten)]
all_in_one_config: all_in_one::Config,
#[clap(subcommand)]
command: Command,
}
@ -184,7 +172,7 @@ fn main() -> Result<(), std::io::Error> {
tokio_runtime.block_on(async move {
let host = config.host;
let headers = config.header;
let log_verbose_count = config.log_verbose_count;
let log_verbose_count = config.all_in_one_config.logging_config.log_verbose_count;
let rpc_timeout = config.rpc_timeout;
let connection = || async move {