Commit ebf97354 authored by Robert Czechowski's avatar Robert Czechowski

Add config flag for template selection

parent 3281c4cf
......@@ -72,6 +72,10 @@ pub struct Opt {
#[structopt(short = "p", long = "port")]
pub port: Option<u16>,
/// Teacher page in task directory
#[structopt(short = "t", long = "template")]
pub template: Option<String>,
/// Reset password of admin user (user_id=1)
#[structopt(short = "a", long = "reset-admin-pw")]
pub resetadminpw: bool,
......@@ -97,7 +101,7 @@ pub struct Opt {
pub enablepasswordlogin: bool,
/// Teacher page in task directory
#[structopt(short = "t", long = "teacherpage")]
#[structopt(short = "T", long = "teacherpage")]
pub teacherpage: Option<String>,
}
......
......@@ -219,6 +219,7 @@ fn main() {
opt.databasefile.map(|x| config.database_file = Some(x));
opt.databaseurl.map(|x| config.database_url = Some(x));
opt.port.map(|x| config.port = Some(x));
opt.template.map(|x| config.template = Some(x));
config.no_contest_scan = if opt.nocontestscan { Some(true) } else { config.no_contest_scan };
config.open_browser = if opt.openbrowser { Some(true) } else { config.open_browser };
config.disable_results_page = if opt.disableresultspage { Some(true) } else { config.disable_results_page };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment