diff --git a/CHANGELOG.md b/CHANGELOG.md index 856ed1750..8017ca916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Patch visualizer now indicates what changes failed to apply. ([#717]) * Add buttons for navigation on the Connected page ([#722]) * Improve tooltip behavior ([#723]) +* Updated CLI output style ([#724]) [#668]: https://github.com/rojo-rbx/rojo/pull/668 [#674]: https://github.com/rojo-rbx/rojo/pull/674 @@ -28,6 +29,7 @@ [#717]: https://github.com/rojo-rbx/rojo/pull/717 [#722]: https://github.com/rojo-rbx/rojo/pull/722 [#723]: https://github.com/rojo-rbx/rojo/pull/723 +[#724]: https://github.com/rojo-rbx/rojo/pull/724 ## [7.3.0] - April 22, 2023 * Added `$attributes` to project format. ([#574]) diff --git a/Cargo.lock b/Cargo.lock index 12e9f8602..b7e43ccbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,6 +35,55 @@ dependencies = [ "memchr", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.70" @@ -112,6 +161,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + [[package]] name = "blake3" version = "1.3.3" @@ -195,49 +250,57 @@ version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "bitflags", - "textwrap 0.11.0", + "bitflags 1.3.2", + "textwrap", "unicode-width", ] [[package]] name = "clap" -version = "3.2.23" +version = "4.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" dependencies = [ - "atty", - "bitflags", + "clap_builder", "clap_derive", - "clap_lex", - "indexmap", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", "strsim", - "termcolor", - "textwrap 0.16.0", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", - "proc-macro-error", "proc-macro2 1.0.56", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "console" @@ -571,7 +634,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "fsevent-sys", ] @@ -590,7 +653,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" dependencies = [ - "bitflags", + "bitflags 1.3.2", "fuchsia-zircon-sys", ] @@ -912,7 +975,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" dependencies = [ - "bitflags", + "bitflags 1.3.2", "inotify-sys", "libc", ] @@ -977,6 +1040,17 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.1", + "rustix 0.38.3", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1031,9 +1105,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.142" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "linked-hash-map" @@ -1047,6 +1121,12 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36eb31c1778188ae1e64398743890d0877fef36d11521ac60406b42016e8c2cf" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "log" version = "0.4.17" @@ -1234,7 +1314,7 @@ version = "4.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" dependencies = [ - "bitflags", + "bitflags 1.3.2", "filetime", "fsevent", "fsevent-sys", @@ -1312,7 +1392,7 @@ version = "0.10.51" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97ea2d98598bf9ada7ea6ee8a30fb74f9156b63bbe495d64ec2b87c269d2dda3" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "foreign-types", "libc", @@ -1360,12 +1440,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "os_str_bytes" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" - [[package]] name = "output_vt100" version = "0.1.3" @@ -1501,30 +1575,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2 1.0.56", - "quote 1.0.26", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2 1.0.56", - "quote 1.0.26", - "version_check", -] - [[package]] name = "proc-macro-hack" version = "0.5.20+deprecated" @@ -1699,7 +1749,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9644faf3ae1858ba10615fa5955c330e49cf0f6ad37a83db3e1c398c4afac12" dependencies = [ "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "blake3", "lazy_static", "rand", @@ -1727,7 +1777,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1736,7 +1786,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1883,7 +1933,7 @@ dependencies = [ "anyhow", "backtrace", "bincode", - "clap 3.2.23", + "clap 4.3.11", "criterion", "crossbeam-channel", "csv", @@ -1957,11 +2007,24 @@ version = "0.37.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b864d3c18a5785a05953adeed93e2dca37ed30f18e69bba9f30079d51f363f" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.4", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.3", "windows-sys 0.48.0", ] @@ -2013,7 +2076,7 @@ version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -2204,7 +2267,7 @@ dependencies = [ "cfg-if 1.0.0", "fastrand", "redox_syscall 0.3.5", - "rustix", + "rustix 0.37.14", "windows-sys 0.45.0", ] @@ -2226,12 +2289,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" version = "1.0.40" @@ -2506,6 +2563,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.3.1" diff --git a/Cargo.toml b/Cargo.toml index bbbbcbf90..cb4159128 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ termcolor = "1.1.2" thiserror = "1.0.30" tokio = { version = "1.12.0", features = ["rt", "rt-multi-thread"] } uuid = { version = "1.0.0", features = ["v4", "serde"] } -clap = { version = "3.1.18", features = ["derive"] } +clap = { version = "4.3.11", features = ["derive"] } profiling = "1.0.6" tracy-client = { version = "0.13.2", optional = true } diff --git a/src/cli/build.rs b/src/cli/build.rs index d6c3f3499..0caa2025d 100644 --- a/src/cli/build.rs +++ b/src/cli/build.rs @@ -5,7 +5,7 @@ use std::{ }; use anyhow::Context; -use clap::Parser; +use clap::Args; use fs_err::File; use memofs::Vfs; use tokio::runtime::Runtime; @@ -18,20 +18,20 @@ const UNKNOWN_OUTPUT_KIND_ERR: &str = "Could not detect what kind of file to bui Expected output file to end in .rbxl, .rbxlx, .rbxm, or .rbxmx."; /// Generates a model or place file from the Rojo project. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct BuildCommand { - /// Path to the project to serve. Defaults to the current directory. - #[clap(default_value = "")] + /// Path to the project to serve. + #[arg(default_value = "default.project.json")] pub project: PathBuf, /// Where to output the result. /// /// Should end in .rbxm, .rbxl, .rbxmx, or .rbxlx. - #[clap(long, short)] + #[arg(long, short)] pub output: PathBuf, /// Whether to automatically rebuild when any input files change. - #[clap(long)] + #[arg(long)] pub watch: bool, } @@ -45,7 +45,7 @@ impl BuildCommand { let vfs = Vfs::new_default(); vfs.set_watch_enabled(self.watch); - let session = ServeSession::new(vfs, &project_path)?; + let session = ServeSession::new(vfs, project_path)?; let mut cursor = session.message_queue().cursor(); write_model(&session, &self.output, output_kind)?; diff --git a/src/cli/doc.rs b/src/cli/doc.rs index 61a8d4168..c94479736 100644 --- a/src/cli/doc.rs +++ b/src/cli/doc.rs @@ -1,7 +1,7 @@ -use clap::Parser; +use clap::Args; /// Open Rojo's documentation in your browser. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct DocCommand {} impl DocCommand { diff --git a/src/cli/fmt_project.rs b/src/cli/fmt_project.rs index 9c3e88d31..29777922b 100644 --- a/src/cli/fmt_project.rs +++ b/src/cli/fmt_project.rs @@ -1,17 +1,17 @@ use std::path::PathBuf; use anyhow::Context; -use clap::Parser; +use clap::Args; use crate::project::Project; use super::resolve_path; /// Reformat a Rojo project using the standard JSON formatting rules. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct FmtProjectCommand { - /// Path to the project to format. Defaults to the current directory. - #[clap(default_value = "")] + /// Path to the project to format. + #[arg(default_value = "default.project.json")] pub project: PathBuf, } diff --git a/src/cli/init.rs b/src/cli/init.rs index b770f55d6..3e333dc4e 100644 --- a/src/cli/init.rs +++ b/src/cli/init.rs @@ -4,7 +4,7 @@ use std::process::{Command, Stdio}; use std::str::FromStr; use anyhow::{bail, format_err}; -use clap::Parser; +use clap::Args; use fs_err as fs; use fs_err::OpenOptions; @@ -22,14 +22,14 @@ static PLACE_README: &str = include_str!("../../assets/default-place-project/REA static PLACE_GIT_IGNORE: &str = include_str!("../../assets/default-place-project/gitignore.txt"); /// Initializes a new Rojo project. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct InitCommand { - /// Path to the place to create the project. Defaults to the current directory. - #[clap(default_value = "")] + /// Path to the place to create the project. + #[arg(default_value = "./")] pub path: PathBuf, /// The kind of project to create, 'place' or 'model'. Defaults to place. - #[clap(long, default_value = "place")] + #[arg(long, default_value = "place")] pub kind: InitKind, } diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 36b329404..b8cd3a6aa 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -11,7 +11,7 @@ mod upload; use std::{borrow::Cow, env, path::Path, str::FromStr}; -use clap::Parser; +use clap::{ArgAction, Args, Parser}; use thiserror::Error; pub use self::build::BuildCommand; @@ -25,13 +25,14 @@ pub use self::upload::UploadCommand; /// Command line options that Rojo accepts, defined using the clap crate. #[derive(Debug, Parser)] -#[clap(name = "Rojo", version, about, author)] +#[command(name = "Rojo", version, about)] +#[command(help_template("{name} {version}{about-section}\n{usage-heading} {usage}\n\n{all-args}"))] pub struct Options { - #[clap(flatten)] + #[command(flatten)] pub global: GlobalOptions, /// Subcommand to run in this invocation. - #[clap(subcommand)] + #[command(subcommand)] pub subcommand: Subcommand, } @@ -50,14 +51,14 @@ impl Options { } } -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct GlobalOptions { /// Sets verbosity level. Can be specified multiple times. - #[clap(long("verbose"), short, global(true), parse(from_occurrences))] + #[arg(long("verbose"), short, global(true), action(ArgAction::Count))] pub verbosity: u8, /// Set color behavior. Valid values are auto, always, and never. - #[clap(long("color"), global(true), default_value("auto"))] + #[arg(long("color"), global(true), default_value("auto"))] pub color: ColorChoice, } diff --git a/src/cli/plugin.rs b/src/cli/plugin.rs index aa8773b35..7753d317c 100644 --- a/src/cli/plugin.rs +++ b/src/cli/plugin.rs @@ -3,7 +3,7 @@ use std::{ io::BufWriter, }; -use clap::Parser; +use clap::{Args, Parser}; use memofs::{InMemoryFs, Vfs, VfsSnapshot}; use roblox_install::RobloxStudio; @@ -13,9 +13,9 @@ static PLUGIN_BINCODE: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/plugin. static PLUGIN_FILE_NAME: &str = "RojoManagedPlugin.rbxm"; /// Install Rojo's plugin. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct PluginCommand { - #[clap(subcommand)] + #[command(subcommand)] subcommand: PluginSubcommand, } diff --git a/src/cli/serve.rs b/src/cli/serve.rs index f89e43875..5ab6dde72 100644 --- a/src/cli/serve.rs +++ b/src/cli/serve.rs @@ -5,7 +5,7 @@ use std::{ sync::Arc, }; -use clap::Parser; +use clap::Args; use memofs::Vfs; use termcolor::{BufferWriter, Color, ColorChoice, ColorSpec, WriteColor}; @@ -17,19 +17,19 @@ const DEFAULT_BIND_ADDRESS: Ipv4Addr = Ipv4Addr::new(127, 0, 0, 1); const DEFAULT_PORT: u16 = 34872; /// Expose a Rojo project to the Rojo Studio plugin. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct ServeCommand { - /// Path to the project to serve. Defaults to the current directory. - #[clap(default_value = "")] + /// Path to the project to serve. + #[arg(default_value = "default.project.json")] pub project: PathBuf, /// The IP address to listen on. Defaults to `127.0.0.1`. - #[clap(long)] + #[arg(long)] pub address: Option, /// The port to listen on. Defaults to the project's preference, or `34872` if /// it has none. - #[clap(long)] + #[arg(long)] pub port: Option, } diff --git a/src/cli/sourcemap.rs b/src/cli/sourcemap.rs index f7bc1691a..833e376b2 100644 --- a/src/cli/sourcemap.rs +++ b/src/cli/sourcemap.rs @@ -4,7 +4,7 @@ use std::{ path::{Path, PathBuf}, }; -use clap::Parser; +use clap::Args; use fs_err::File; use memofs::Vfs; use rayon::prelude::*; @@ -36,26 +36,25 @@ struct SourcemapNode<'a> { } /// Generates a sourcemap file from the Rojo project. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct SourcemapCommand { - /// Path to the project to use for the sourcemap. Defaults to the current - /// directory. - #[clap(default_value = "")] + /// Path to the project to use for the sourcemap. + #[arg(default_value = "default.project.json")] pub project: PathBuf, /// Where to output the sourcemap. Omit this to use stdout instead of /// writing to a file. /// /// Should end in .json. - #[clap(long, short)] + #[arg(long, short)] pub output: Option, /// If non-script files should be included or not. Defaults to false. - #[clap(long)] + #[arg(long)] pub include_non_scripts: bool, /// Whether to automatically recreate a snapshot when any input files change. - #[clap(long)] + #[arg(long)] pub watch: bool, } @@ -67,7 +66,7 @@ impl SourcemapCommand { let vfs = Vfs::new_default(); vfs.set_watch_enabled(self.watch); - let session = ServeSession::new(vfs, &project_path)?; + let session = ServeSession::new(vfs, project_path)?; let mut cursor = session.message_queue().cursor(); let filter = if self.include_non_scripts { diff --git a/src/cli/upload.rs b/src/cli/upload.rs index ce7a2b5d5..319f40b23 100644 --- a/src/cli/upload.rs +++ b/src/cli/upload.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use std::str::FromStr; use anyhow::{bail, format_err, Context}; -use clap::Parser; +use clap::Args; use memofs::Vfs; use reqwest::{ header::{ACCEPT, CONTENT_TYPE, COOKIE, USER_AGENT}, @@ -14,26 +14,26 @@ use crate::{auth_cookie::get_auth_cookie, serve_session::ServeSession}; use super::resolve_path; /// Builds the project and uploads it to Roblox. -#[derive(Debug, Parser)] +#[derive(Debug, Args)] pub struct UploadCommand { - /// Path to the project to upload. Defaults to the current directory. - #[clap(default_value = "")] + /// Path to the project to upload. + #[arg(default_value = "default.project.json")] pub project: PathBuf, /// Authenication cookie to use. If not specified, Rojo will attempt to find one from the system automatically. - #[clap(long)] + #[arg(long)] pub cookie: Option, /// API key obtained from create.roblox.com/credentials. Rojo will use the Open Cloud API when this is provided. Only supports uploading to a place. - #[clap(long = "api_key")] + #[arg(long = "api_key")] pub api_key: Option, /// The Universe ID of the given place. Required when using the Open Cloud API. - #[clap(long = "universe_id")] + #[arg(long = "universe_id")] pub universe_id: Option, /// Asset ID to upload to. - #[clap(long = "asset_id")] + #[arg(long = "asset_id")] pub asset_id: u64, }