pub fn parse_arguments() -> (Config, StateConfig) {
        const CREATE_ADMIN: &'static str = "create_admin";
        const SECRET_KEY: &'static str = "secret_key";

        let matches = App::new("Weekend At Joes Backend")
            .version("0.1.0")
            .author("Henry Zimmerman")
            .about("Monolithic server for the API and frontend of the Weekend at Joes website.")
            .arg(
                Arg::with_name(CREATE_ADMIN)
                    .long("create_admin")
                    .help("Creates an administrator user if one doesn't already exist.")
                    .takes_value(false),
            )
            .arg(
                Arg::with_name(SECRET_KEY)
                    .long("secret")
                    .short("s")
                    .value_name("KEY")
                    .help(
                        "A key string that is used to sign and verify user tokens. By specifying the same key across restarts, user tokens will not be invalidated. If no key is provided, then a random one is generated.",
                    )
                    .takes_value(true),
            )
            .get_matches();

        let create_admin: bool = matches.is_present(CREATE_ADMIN);
        let secret_key: Option<String> = matches.value_of(SECRET_KEY).map(String::from);

        let database_url: String = pool::DATABASE_URL.to_string();

        let config = Config { create_admin };

        let state_config = StateConfig {
            specified_secret: secret_key,
            database_url,
        };
        (config, state_config)
    }
/// Parses CLI arguments and provides a config for pre-launch setup and another config the server.
Parses CLI arguments and provides a config for pre-launch setup and another config the server.
Parses CLI arguments and provides a config for pre - launch setup and another config the server .
pub fn parse_arguments() -> (Config, StateConfig) {
        const CREATE_ADMIN: &'static str = "create_admin";
        const SECRET_KEY: &'static str = "secret_key";
        let matches = App::new("Weekend At Joes Backend")
            .version("0.1.0")
            .author("Henry Zimmerman")
            .about("Monolithic server for the API and frontend of the Weekend at Joes website.")
            .arg(
                Arg::with_name(CREATE_ADMIN)
                    .long("create_admin")
                    .help("Creates an administrator user if one doesn't already exist.")
                    .takes_value(false),
            )
            .arg(
                Arg::with_name(SECRET_KEY)
                    .long("secret")
                    .short("s")
                    .value_name("KEY")
                    .help(
                        "A key string that is used to sign and verify user tokens. By specifying the same key across restarts, user tokens will not be invalidated. If no key is provided, then a random one is generated.",
                    )
                    .takes_value(true),
            )
            .get_matches();
        let create_admin: bool = matches.is_present(CREATE_ADMIN);
        let secret_key: Option<String> = matches.value_of(SECRET_KEY).map(String::from);
        let database_url: String = pool::DATABASE_URL.to_string();
        let config = Config { create_admin };
        let state_config = StateConfig {
            specified_secret: secret_key,
            database_url,
        };
        (config, state_config)
    }
pub fn parse_arguments ( ) -> ( Config , StateConfig ) { const CREATE_ADMIN : & ' static str = " " ; const SECRET_KEY : & ' static str = " " ; let matches = App :: new ( " " ) . version ( " " ) . author ( " " ) . about ( " " ) . arg ( Arg :: with_name ( CREATE_ADMIN ) . long ( " " ) . help ( " " ) . takes_value ( false ) , ) . arg ( Arg :: with_name ( SECRET_KEY ) . long ( " " ) . short ( " " ) . value_name ( " " ) . help ( " " , ) . takes_value ( true ) , ) . get_matches ( ) ; let create_admin : bool = matches . is_present ( CREATE_ADMIN ) ; let secret_key : Option < String > = matches . value_of ( SECRET_KEY ) . map ( String :: from ) ; let database_url : String = pool :: DATABASE_URL . to_string ( ) ; let config = Config { create_admin } ; let state_config = StateConfig { specified_secret : secret_key , database_url , } ; ( config , state_config ) }
Parses CLI arguments and provides a config for pre-launch setup and another config the server.
Parses CLI arguments and provides a config for pre - launch setup and another config the server .