add launch resume & environment

This commit is contained in:
qdequele
2020-02-06 15:42:35 +01:00
parent 257b7b4df4
commit ad83c3ab5a
3 changed files with 70 additions and 6 deletions

View File

@ -1,5 +1,7 @@
use structopt::StructOpt;
const POSSIBLE_ENV: [&str; 2] = ["development", "production"];
#[derive(Debug, Clone, StructOpt)]
pub struct Opt {
/// The destination where the database must be created.
@ -14,6 +16,13 @@ pub struct Opt {
#[structopt(long, env = "MEILI_MASTER_KEY")]
pub master_key: Option<String>,
/// This environment variable must be set to `production` if your are running in production.
/// Could be `production` or `development`
/// - `production`: Force api keys
/// - `development`: Show logs in "info" mode + not mendatory to specify the api keys
#[structopt(long, env = "MEILI_ENV", default_value = "development", possible_values = &POSSIBLE_ENV)]
pub env: String,
/// Do not send analytics to Meili.
#[structopt(long, env = "MEILI_NO_ANALYTICS")]
pub no_analytics: bool,