From ea112dd93d05cf775209f73fb5351811cd2e6d4e Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Wed, 28 Aug 2019 12:09:12 -0700 Subject: [PATCH] Mark security cookie as optional --- src/bin.rs | 6 +++--- src/commands/upload.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin.rs b/src/bin.rs index f55c61aa..f4d69fdc 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -54,7 +54,7 @@ fn main() { (about: "Generates a place or model file out of the project and uploads it to Roblox.") (@arg PROJECT: "Path to the project to upload. Defaults to the current directory.") (@arg kind: --kind +takes_value "The kind of asset to generate, 'place', or 'model'. Defaults to place.") - (@arg cookie: --cookie +takes_value +required "Security cookie to authenticate with.") + (@arg cookie: --cookie +takes_value "Security cookie to authenticate with. If not specified, Rojo will attempt to find one from the system automatically.") (@arg asset_id: --asset_id +takes_value +required "Asset ID to upload to.") ) ); @@ -172,7 +172,7 @@ fn start_upload(sub_matches: &ArgMatches) { }; let kind = sub_matches.value_of("kind"); - let security_cookie = sub_matches.value_of("cookie").unwrap(); + let security_cookie = sub_matches.value_of("cookie").map(Into::into); let asset_id: u64 = { let arg = sub_matches.value_of("asset_id").unwrap(); @@ -188,7 +188,7 @@ fn start_upload(sub_matches: &ArgMatches) { let options = commands::UploadOptions { fuzzy_project_path, - security_cookie: security_cookie.to_string(), + security_cookie: security_cookie, asset_id, kind, }; diff --git a/src/commands/upload.rs b/src/commands/upload.rs index c4a67afa..b7fced34 100644 --- a/src/commands/upload.rs +++ b/src/commands/upload.rs @@ -11,7 +11,7 @@ pub enum UploadError { #[derive(Debug)] pub struct UploadOptions<'a> { pub fuzzy_project_path: PathBuf, - pub security_cookie: String, + pub security_cookie: Option, pub asset_id: u64, pub kind: Option<&'a str>, }