Skip to content

Commit

Permalink
cli: Rename opt.rs to args.rs
Browse files Browse the repository at this point in the history
This has bothered me for so long
  • Loading branch information
adierking committed Aug 4, 2024
1 parent 6df85d5 commit a5f5a00
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 23 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion unplug-cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub mod stage;
#[cfg(feature = "debug")]
pub mod debug;

use crate::args::Command;
use crate::context::Context;
use crate::opt::Command;
use anyhow::Result;

/// Runs a CLI command using `ctx`.
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/archive.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::archive::*;
use crate::args::archive::*;

use crate::common::output_dir_and_name;
use crate::context::Context;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/audio.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::audio::*;
use crate::args::audio::*;

use crate::common::{format_duration, output_dir_and_name};
use crate::context::{Context, FileId, OpenContext};
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::config::*;
use crate::args::config::*;

use crate::config::{Config, Settings};
use crate::context::Context;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/debug.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::debug::*;
use crate::args::debug::*;

use crate::context::Context;
use anyhow::Result;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/dolphin.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::dolphin::*;
use crate::args::dolphin::*;

use crate::config::Config;
use crate::context::Context;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/globals.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::globals::*;
use crate::args::globals::*;

use crate::context::Context;
use crate::io::OutputRedirect;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/iso.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::iso::*;
use crate::args::iso::*;

use crate::common::output_dir_and_name;
use crate::context::Context;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/list.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::list::*;
use crate::args::list::*;

use crate::context::Context;
use anyhow::Result;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/messages.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::messages::*;
use crate::args::messages::*;

use crate::context::Context;
use crate::msg::{self, MessageId, MessageReader, MessageSource, MessageWriter};
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/project.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::project::*;
use crate::args::project::*;

use crate::common::IString;
use crate::config::{Config, Project, ProjectKind};
Expand Down
6 changes: 3 additions & 3 deletions unplug-cli/src/commands/script.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::script::*;
use crate::args::script::*;

use crate::common::find_stage_file;
use crate::context::Context;
Expand Down Expand Up @@ -288,8 +288,8 @@ fn command_assemble(ctx: Context, args: AssembleArgs) -> Result<()> {
}

/// The `script` CLI command.
pub fn command(ctx: Context, args: Subcommand) -> Result<()> {
match args {
pub fn command(ctx: Context, command: Subcommand) -> Result<()> {
match command {
Subcommand::Dump(args) if args.stage == "globals" => command_dump_globals(ctx, args),
Subcommand::Dump(args) => command_dump(ctx, args),
Subcommand::DumpAll(args) => command_dump_all(ctx, args),
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/shop.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::shop::*;
use crate::args::shop::*;

use crate::context::Context;
use crate::io::OutputRedirect;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/commands/stage.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::stage::*;
use crate::args::stage::*;

use crate::common::find_stage_file;
use crate::context::Context;
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/fst.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::opt::list::Options;
use crate::args::list::Options;
use anyhow::{bail, Result};
use log::info;
use std::fs::{self, File};
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod args;
pub mod commands;
pub mod common;
pub mod config;
Expand All @@ -7,6 +8,5 @@ pub mod id;
pub mod io;
pub mod json;
pub mod msg;
pub mod opt;
pub mod playback;
pub mod terminal;
2 changes: 1 addition & 1 deletion unplug-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use clap::Parser;
use log::error;
use std::path::Path;
use std::process;
use unplug_cli::args::{CliArgs, GlobalConfigArgs, GlobalContextArgs};
use unplug_cli::config::{self, Config};
use unplug_cli::context::Context;
use unplug_cli::opt::{CliArgs, GlobalConfigArgs, GlobalContextArgs};
use unplug_cli::{commands, terminal};

#[cfg(feature = "trace")]
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/tests/reimport_globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use std::fs::File;
use tempfile::NamedTempFile;
use unplug::dvd::{ArchiveReader, DiscStream, OpenFile};
use unplug::globals::GlobalsReader;
use unplug_cli::args::globals::{ExportArgs, ImportArgs};
use unplug_cli::commands::globals;
use unplug_cli::context::Context;
use unplug_cli::opt::globals::{ExportArgs, ImportArgs};
use unplug_test as common;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/tests/reimport_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use unplug::event::msg::MsgArgs;
use unplug::event::Script;
use unplug::globals::GlobalsReader;
use unplug::stage::Stage;
use unplug_cli::args::messages::{ExportArgs, ImportArgs};
use unplug_cli::commands::messages;
use unplug_cli::context::Context;
use unplug_cli::msg::{iter_messages, MessageId, MessageSource};
use unplug_cli::opt::messages::{ExportArgs, ImportArgs};
use unplug_test as common;

fn collect_messages(source: MessageSource, script: &Script) -> Vec<(MessageId, &MsgArgs)> {
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/tests/reimport_shop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use unplug::dvd::{ArchiveReader, DiscStream, OpenFile};
use unplug::globals::GlobalsReader;
use unplug::shop::Shop;
use unplug::stage::Stage;
use unplug_cli::args::shop::{ExportArgs, ImportArgs};
use unplug_cli::commands::shop;
use unplug_cli::context::Context;
use unplug_cli::opt::shop::{ExportArgs, ImportArgs};
use unplug_test as common;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion unplug-cli/tests/reimport_stages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use unplug::data::{Resource, Stage as StageId};
use unplug::dvd::{ArchiveReader, DiscStream, OpenFile};
use unplug::globals::GlobalsReader;
use unplug::stage::Stage;
use unplug_cli::args::stage::{ExportAllArgs, ImportAllArgs};
use unplug_cli::commands::stage;
use unplug_cli::context::Context;
use unplug_cli::opt::stage::{ExportAllArgs, ImportAllArgs};
use unplug_test as common;

#[test]
Expand Down

0 comments on commit a5f5a00

Please sign in to comment.