diff --git a/src/cli.rs b/src/cli.rs index ed6e282..6f1f38d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -83,6 +83,10 @@ pub struct Opt { /// Attempt to re-use session cookies #[structopt(long)] pub keep_session: bool, + + /// Download all courses + #[structopt(long)] + pub all: bool, } pub static LOG_LEVEL: AtomicUsize = AtomicUsize::new(0); diff --git a/src/main.rs b/src/main.rs index 3ebc493..c01f1a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -160,9 +160,14 @@ async fn real_main(mut opt: Opt) -> Result<()> { PROGRESS_BAR.set_message("initializing.."); } - let sync_url = ilias.opt.sync_url.as_deref().unwrap_or(DEFAULT_SYNC_URL); + let sync_url = if ilias.opt.all { + // change on ILIAS update + format!("{}ilias.php?cmdClass=ilmembershipoverviewgui&cmdNode=iy&baseClass=ilmembershipoverviewgui", ILIAS_URL) + } else { + ilias.opt.sync_url.as_deref().unwrap_or(DEFAULT_SYNC_URL).to_owned() + }; let obj = Object::from_url( - URL::from_href(sync_url).context("invalid sync URL")?, + URL::from_href(&sync_url).context("invalid sync URL")?, String::new(), None, )