Update dependencies and improve CLI argument handling

- Updated various dependencies in Cargo.toml and Cargo.lock, including `env_logger`, `fs-err`, and `clap`, to their latest versions for enhanced functionality and security.
- Refactored CLI argument handling in `build.rs` and `mod.rs` to align with the new `clap` version, improving error reporting and verbosity options.
- Added new packages such as `anstream`, `colorchoice`, and `jiff` to enhance project capabilities.
This commit is contained in:
Joe 2026-01-30 05:22:39 -06:00
parent 249e26367b
commit 8ede87e1cf
7 changed files with 267 additions and 152 deletions

View file

@ -50,7 +50,7 @@ impl BuildCommand {
(None, None) => {
BuildCommand::command()
.error(
clap::ErrorKind::MissingRequiredArgument,
clap::error::ErrorKind::MissingRequiredArgument,
"one of the following arguments must be provided: \n --output <OUTPUT>\n --plugin <PLUGIN>",
)
.exit();

View file

@ -56,7 +56,7 @@ impl Options {
#[derive(Debug, Parser)]
pub struct GlobalOptions {
/// Sets verbosity level. Can be specified multiple times.
#[clap(long("verbose"), short, global(true), parse(from_occurrences))]
#[clap(long("verbose"), short, global(true), action = clap::ArgAction::Count)]
pub verbosity: u8,
/// Set color behavior. Valid values are auto, always, and never.

View file

@ -244,16 +244,10 @@ impl RojoTree {
// The root of the tree doesn't appear in the path, so we start with
// the root's children.
for (i, segment) in segments.iter().enumerate() {
for segment in segments.iter() {
let current = self.inner.get_by_ref(current_ref)?;
// For the first segment, check direct children of root
// For subsequent segments, check children of current
let children = if i == 0 {
current.children()
} else {
current.children()
};
let children = current.children();
let mut found = false;
for &child_ref in children {

View file

@ -18,8 +18,10 @@ pub fn snapshot_toml(
name: &str,
) -> anyhow::Result<Option<InstanceSnapshot>> {
let contents = vfs.read(path)?;
let contents_str = std::str::from_utf8(&contents)
.with_context(|| format!("File is not valid UTF-8: {}", path.display()))?;
let value: toml::Value = toml::from_slice(&contents)
let value: toml::Value = toml::from_str(contents_str)
.with_context(|| format!("File contains malformed TOML: {}", path.display()))?;
let as_lua = toml_to_lua(value).to_string();