From 3f80f3acd90c9782420cc0d33fcf77035e522b15 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 11 Feb 2026 10:15:55 +0900 Subject: enable workspace --- Cargo.toml | 12 +- crates/mozart/Cargo.toml | 9 + crates/mozart/src/commands.rs | 230 ++++++++++++++++++++++ crates/mozart/src/commands/about.rs | 8 + crates/mozart/src/commands/archive.rs | 30 +++ crates/mozart/src/commands/audit.rs | 32 +++ crates/mozart/src/commands/browse.rs | 19 ++ crates/mozart/src/commands/bump.rs | 23 +++ crates/mozart/src/commands/check_platform_reqs.rs | 20 ++ crates/mozart/src/commands/clear_cache.rs | 12 ++ crates/mozart/src/commands/config.rs | 58 ++++++ crates/mozart/src/commands/create_project.rs | 105 ++++++++++ crates/mozart/src/commands/depends.rs | 23 +++ crates/mozart/src/commands/diagnose.rs | 8 + crates/mozart/src/commands/dump_autoload.rs | 52 +++++ crates/mozart/src/commands/exec.rs | 19 ++ crates/mozart/src/commands/fund.rs | 12 ++ crates/mozart/src/commands/global.rs | 15 ++ crates/mozart/src/commands/init.rs | 52 +++++ crates/mozart/src/commands/install.rs | 91 +++++++++ crates/mozart/src/commands/licenses.rs | 20 ++ crates/mozart/src/commands/outdated.rs | 67 +++++++ crates/mozart/src/commands/prohibits.rs | 26 +++ crates/mozart/src/commands/reinstall.rs | 59 ++++++ crates/mozart/src/commands/remove.rs | 95 +++++++++ crates/mozart/src/commands/repository.rs | 40 ++++ crates/mozart/src/commands/require.rs | 123 ++++++++++++ crates/mozart/src/commands/run_script.rs | 31 +++ crates/mozart/src/commands/search.rs | 28 +++ crates/mozart/src/commands/self_update.rs | 55 ++++++ crates/mozart/src/commands/show.rs | 102 ++++++++++ crates/mozart/src/commands/status.rs | 8 + crates/mozart/src/commands/suggests.rs | 31 +++ crates/mozart/src/commands/update.rs | 131 ++++++++++++ crates/mozart/src/commands/validate.rs | 39 ++++ crates/mozart/src/lib.rs | 1 + crates/mozart/src/main.rs | 7 + src/commands.rs | 230 ---------------------- src/commands/about.rs | 8 - src/commands/archive.rs | 30 --- src/commands/audit.rs | 32 --- src/commands/browse.rs | 19 -- src/commands/bump.rs | 23 --- src/commands/check_platform_reqs.rs | 20 -- src/commands/clear_cache.rs | 12 -- src/commands/config.rs | 58 ------ src/commands/create_project.rs | 105 ---------- src/commands/depends.rs | 23 --- src/commands/diagnose.rs | 8 - src/commands/dump_autoload.rs | 52 ----- src/commands/exec.rs | 19 -- src/commands/fund.rs | 12 -- src/commands/global.rs | 15 -- src/commands/init.rs | 52 ----- src/commands/install.rs | 91 --------- src/commands/licenses.rs | 20 -- src/commands/outdated.rs | 67 ------- src/commands/prohibits.rs | 26 --- src/commands/reinstall.rs | 59 ------ src/commands/remove.rs | 95 --------- src/commands/repository.rs | 40 ---- src/commands/require.rs | 123 ------------ src/commands/run_script.rs | 31 --- src/commands/search.rs | 28 --- src/commands/self_update.rs | 55 ------ src/commands/show.rs | 102 ---------- src/commands/status.rs | 8 - src/commands/suggests.rs | 31 --- src/commands/update.rs | 131 ------------ src/commands/validate.rs | 39 ---- src/lib.rs | 1 - src/main.rs | 7 - 72 files changed, 1686 insertions(+), 1679 deletions(-) create mode 100644 crates/mozart/Cargo.toml create mode 100644 crates/mozart/src/commands.rs create mode 100644 crates/mozart/src/commands/about.rs create mode 100644 crates/mozart/src/commands/archive.rs create mode 100644 crates/mozart/src/commands/audit.rs create mode 100644 crates/mozart/src/commands/browse.rs create mode 100644 crates/mozart/src/commands/bump.rs create mode 100644 crates/mozart/src/commands/check_platform_reqs.rs create mode 100644 crates/mozart/src/commands/clear_cache.rs create mode 100644 crates/mozart/src/commands/config.rs create mode 100644 crates/mozart/src/commands/create_project.rs create mode 100644 crates/mozart/src/commands/depends.rs create mode 100644 crates/mozart/src/commands/diagnose.rs create mode 100644 crates/mozart/src/commands/dump_autoload.rs create mode 100644 crates/mozart/src/commands/exec.rs create mode 100644 crates/mozart/src/commands/fund.rs create mode 100644 crates/mozart/src/commands/global.rs create mode 100644 crates/mozart/src/commands/init.rs create mode 100644 crates/mozart/src/commands/install.rs create mode 100644 crates/mozart/src/commands/licenses.rs create mode 100644 crates/mozart/src/commands/outdated.rs create mode 100644 crates/mozart/src/commands/prohibits.rs create mode 100644 crates/mozart/src/commands/reinstall.rs create mode 100644 crates/mozart/src/commands/remove.rs create mode 100644 crates/mozart/src/commands/repository.rs create mode 100644 crates/mozart/src/commands/require.rs create mode 100644 crates/mozart/src/commands/run_script.rs create mode 100644 crates/mozart/src/commands/search.rs create mode 100644 crates/mozart/src/commands/self_update.rs create mode 100644 crates/mozart/src/commands/show.rs create mode 100644 crates/mozart/src/commands/status.rs create mode 100644 crates/mozart/src/commands/suggests.rs create mode 100644 crates/mozart/src/commands/update.rs create mode 100644 crates/mozart/src/commands/validate.rs create mode 100644 crates/mozart/src/lib.rs create mode 100644 crates/mozart/src/main.rs delete mode 100644 src/commands.rs delete mode 100644 src/commands/about.rs delete mode 100644 src/commands/archive.rs delete mode 100644 src/commands/audit.rs delete mode 100644 src/commands/browse.rs delete mode 100644 src/commands/bump.rs delete mode 100644 src/commands/check_platform_reqs.rs delete mode 100644 src/commands/clear_cache.rs delete mode 100644 src/commands/config.rs delete mode 100644 src/commands/create_project.rs delete mode 100644 src/commands/depends.rs delete mode 100644 src/commands/diagnose.rs delete mode 100644 src/commands/dump_autoload.rs delete mode 100644 src/commands/exec.rs delete mode 100644 src/commands/fund.rs delete mode 100644 src/commands/global.rs delete mode 100644 src/commands/init.rs delete mode 100644 src/commands/install.rs delete mode 100644 src/commands/licenses.rs delete mode 100644 src/commands/outdated.rs delete mode 100644 src/commands/prohibits.rs delete mode 100644 src/commands/reinstall.rs delete mode 100644 src/commands/remove.rs delete mode 100644 src/commands/repository.rs delete mode 100644 src/commands/require.rs delete mode 100644 src/commands/run_script.rs delete mode 100644 src/commands/search.rs delete mode 100644 src/commands/self_update.rs delete mode 100644 src/commands/show.rs delete mode 100644 src/commands/status.rs delete mode 100644 src/commands/suggests.rs delete mode 100644 src/commands/update.rs delete mode 100644 src/commands/validate.rs delete mode 100644 src/lib.rs delete mode 100644 src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 22f13e2..f6a929e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,7 @@ -[package] -name = "mozart" +[workspace] +resolver = "3" +members = ["crates/*"] + +[workspace.package] version = "0.1.0" edition = "2024" - -[dependencies] -clap = { version = "4.5.57", features = ["derive"] } -reqwest = "0.13.2" -tokio = { version = "1.49.0", features = ["full"] } diff --git a/crates/mozart/Cargo.toml b/crates/mozart/Cargo.toml new file mode 100644 index 0000000..ebb67d6 --- /dev/null +++ b/crates/mozart/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "mozart" +version.workspace = true +edition.workspace = true + +[dependencies] +clap = { version = "4.5.57", features = ["derive"] } +reqwest = "0.13.2" +tokio = { version = "1.49.0", features = ["full"] } diff --git a/crates/mozart/src/commands.rs b/crates/mozart/src/commands.rs new file mode 100644 index 0000000..f31dd44 --- /dev/null +++ b/crates/mozart/src/commands.rs @@ -0,0 +1,230 @@ +pub mod about; +pub mod archive; +pub mod audit; +pub mod browse; +pub mod bump; +pub mod check_platform_reqs; +pub mod clear_cache; +pub mod config; +pub mod create_project; +pub mod depends; +pub mod diagnose; +pub mod dump_autoload; +pub mod exec; +pub mod fund; +pub mod global; +pub mod init; +pub mod install; +pub mod licenses; +pub mod outdated; +pub mod prohibits; +pub mod reinstall; +pub mod remove; +pub mod repository; +pub mod require; +pub mod run_script; +pub mod search; +pub mod self_update; +pub mod show; +pub mod status; +pub mod suggests; +pub mod update; +pub mod validate; + +#[derive(clap::Parser)] +#[command(name = "mozart", version, about = "A PHP dependency manager")] +pub struct Cli { + #[command(subcommand)] + pub command: Commands, + + /// Increase the verbosity of messages: 1 for normal, 2 for more verbose, 3 for debug + #[arg(short, long, action = clap::ArgAction::Count, global = true)] + pub verbose: u8, + + /// Display timing and memory usage information + #[arg(long, global = true)] + pub profile: bool, + + /// Disables all plugins + #[arg(long, global = true)] + pub no_plugins: bool, + + /// Skips execution of all scripts defined in composer.json + #[arg(long, global = true)] + pub no_scripts: bool, + + /// If specified, use the given directory as working directory + #[arg(short = 'd', long = "working-dir", global = true)] + pub working_dir: Option, + + /// Prevent use of the cache + #[arg(long, global = true)] + pub no_cache: bool, + + /// Do not ask any interactive question + #[arg(short = 'n', long, global = true)] + pub no_interaction: bool, + + /// Do not output any message + #[arg(short, long, global = true)] + pub quiet: bool, + + /// Force ANSI output + #[arg(long, global = true)] + pub ansi: bool, + + /// Disable ANSI output + #[arg(long, global = true)] + pub no_ansi: bool, +} + +#[derive(clap::Subcommand)] +pub enum Commands { + /// Short information about Composer + About(about::AboutArgs), + + /// Creates an archive of this composer package + Archive(archive::ArchiveArgs), + + /// Checks for security vulnerability advisories for installed packages + Audit(audit::AuditArgs), + + /// Opens the package's repository URL or homepage in your browser + #[command(alias = "home")] + Browse(browse::BrowseArgs), + + /// Increases the lower limit of your package version constraints + Bump(bump::BumpArgs), + + /// Check that platform requirements are satisfied + #[command(name = "check-platform-reqs")] + CheckPlatformReqs(check_platform_reqs::CheckPlatformReqsArgs), + + /// Clears Composer's internal package cache + #[command(name = "clear-cache", alias = "clearcache", alias = "cc")] + ClearCache(clear_cache::ClearCacheArgs), + + /// Sets config options + Config(config::ConfigArgs), + + /// Creates new project from a package into given directory + #[command(name = "create-project")] + CreateProject(create_project::CreateProjectArgs), + + /// Shows which packages cause the given package to be installed + #[command(alias = "why")] + Depends(depends::DependsArgs), + + /// Diagnoses the system to identify common errors + Diagnose(diagnose::DiagnoseArgs), + + /// Dumps the autoloader + #[command(name = "dump-autoload", alias = "dumpautoload")] + DumpAutoload(dump_autoload::DumpAutoloadArgs), + + /// Executes a vendored binary/script + Exec(exec::ExecArgs), + + /// Discover how to help fund the maintenance of your dependencies + Fund(fund::FundArgs), + + /// Allows running commands in the global Composer dir + Global(global::GlobalArgs), + + /// Creates a basic composer.json file in current directory + Init(init::InitArgs), + + /// Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json + #[command(alias = "i")] + Install(install::InstallArgs), + + /// Shows information about licenses of dependencies + Licenses(licenses::LicensesArgs), + + /// Shows a list of installed packages that have updates available + Outdated(outdated::OutdatedArgs), + + /// Shows which packages prevent the given package from being installed + #[command(alias = "why-not")] + Prohibits(prohibits::ProhibitsArgs), + + /// Uninstalls and reinstalls the given package names + Reinstall(reinstall::ReinstallArgs), + + /// Removes a package from the require or require-dev + #[command(alias = "rm", alias = "uninstall")] + Remove(remove::RemoveArgs), + + /// Manage repositories + #[command(alias = "repo")] + Repository(repository::RepositoryArgs), + + /// Adds required packages to your composer.json and installs them + #[command(alias = "r")] + Require(require::RequireArgs), + + /// Runs the scripts defined in composer.json + #[command(name = "run-script", alias = "run")] + RunScript(run_script::RunScriptArgs), + + /// Searches for packages + Search(search::SearchArgs), + + /// Updates Composer to the latest version + #[command(name = "self-update", alias = "selfupdate")] + SelfUpdate(self_update::SelfUpdateArgs), + + /// Shows information about packages + #[command(alias = "info")] + Show(show::ShowArgs), + + /// Shows a list of locally modified packages + Status(status::StatusArgs), + + /// Shows package suggestions + Suggests(suggests::SuggestsArgs), + + /// Updates your dependencies to the latest version according to composer.json + #[command(alias = "u", alias = "upgrade")] + Update(update::UpdateArgs), + + /// Validates a composer.json and composer.lock + Validate(validate::ValidateArgs), +} + +pub fn execute(command: &Commands) { + match command { + Commands::About(args) => about::execute(args), + Commands::Archive(args) => archive::execute(args), + Commands::Audit(args) => audit::execute(args), + Commands::Browse(args) => browse::execute(args), + Commands::Bump(args) => bump::execute(args), + Commands::CheckPlatformReqs(args) => check_platform_reqs::execute(args), + Commands::ClearCache(args) => clear_cache::execute(args), + Commands::Config(args) => config::execute(args), + Commands::CreateProject(args) => create_project::execute(args), + Commands::Depends(args) => depends::execute(args), + Commands::Diagnose(args) => diagnose::execute(args), + Commands::DumpAutoload(args) => dump_autoload::execute(args), + Commands::Exec(args) => exec::execute(args), + Commands::Fund(args) => fund::execute(args), + Commands::Global(args) => global::execute(args), + Commands::Init(args) => init::execute(args), + Commands::Install(args) => install::execute(args), + Commands::Licenses(args) => licenses::execute(args), + Commands::Outdated(args) => outdated::execute(args), + Commands::Prohibits(args) => prohibits::execute(args), + Commands::Reinstall(args) => reinstall::execute(args), + Commands::Remove(args) => remove::execute(args), + Commands::Repository(args) => repository::execute(args), + Commands::Require(args) => require::execute(args), + Commands::RunScript(args) => run_script::execute(args), + Commands::Search(args) => search::execute(args), + Commands::SelfUpdate(args) => self_update::execute(args), + Commands::Show(args) => show::execute(args), + Commands::Status(args) => status::execute(args), + Commands::Suggests(args) => suggests::execute(args), + Commands::Update(args) => update::execute(args), + Commands::Validate(args) => validate::execute(args), + } +} diff --git a/crates/mozart/src/commands/about.rs b/crates/mozart/src/commands/about.rs new file mode 100644 index 0000000..833b6c8 --- /dev/null +++ b/crates/mozart/src/commands/about.rs @@ -0,0 +1,8 @@ +use clap::Args; + +#[derive(Args)] +pub struct AboutArgs {} + +pub fn execute(_args: &AboutArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/archive.rs b/crates/mozart/src/commands/archive.rs new file mode 100644 index 0000000..1fbef6c --- /dev/null +++ b/crates/mozart/src/commands/archive.rs @@ -0,0 +1,30 @@ +use clap::Args; + +#[derive(Args)] +pub struct ArchiveArgs { + /// The package name + pub package: Option, + + /// A version constraint + pub version: Option, + + /// Format of the resulting archive (tar, tar.gz, tar.bz2, zip) + #[arg(short, long)] + pub format: Option, + + /// Write the archive to this directory + #[arg(long)] + pub dir: Option, + + /// Write the archive with the given file name + #[arg(long)] + pub file: Option, + + /// Ignore filters when saving archive + #[arg(long)] + pub ignore_filters: bool, +} + +pub fn execute(_args: &ArchiveArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/audit.rs b/crates/mozart/src/commands/audit.rs new file mode 100644 index 0000000..02b0d8d --- /dev/null +++ b/crates/mozart/src/commands/audit.rs @@ -0,0 +1,32 @@ +use clap::Args; + +#[derive(Args)] +pub struct AuditArgs { + /// Disables installation of require-dev packages + #[arg(long)] + pub no_dev: bool, + + /// Output format (table, plain, json, summary) + #[arg(short, long, default_value = "table")] + pub format: String, + + /// Audit packages from the lock file + #[arg(long)] + pub locked: bool, + + /// Handling of abandoned packages (ignore, report, fail) + #[arg(long)] + pub abandoned: Option, + + /// Ignore advisories of a given severity (low, medium, high, critical) + #[arg(long)] + pub ignore_severity: Vec, + + /// Ignore advisories from sources that are unreachable + #[arg(long)] + pub ignore_unreachable: bool, +} + +pub fn execute(_args: &AuditArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/browse.rs b/crates/mozart/src/commands/browse.rs new file mode 100644 index 0000000..b6cb08f --- /dev/null +++ b/crates/mozart/src/commands/browse.rs @@ -0,0 +1,19 @@ +use clap::Args; + +#[derive(Args)] +pub struct BrowseArgs { + /// Package(s) to browse + pub packages: Vec, + + /// Open the homepage instead of the repository URL + #[arg(short = 'H', long)] + pub homepage: bool, + + /// Only show the homepage or repository URL + #[arg(short, long)] + pub show: bool, +} + +pub fn execute(_args: &BrowseArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/bump.rs b/crates/mozart/src/commands/bump.rs new file mode 100644 index 0000000..40e01f1 --- /dev/null +++ b/crates/mozart/src/commands/bump.rs @@ -0,0 +1,23 @@ +use clap::Args; + +#[derive(Args)] +pub struct BumpArgs { + /// Package(s) to bump + pub packages: Vec, + + /// Only bump packages in require-dev + #[arg(short = 'D', long)] + pub dev_only: bool, + + /// Only bump packages in require + #[arg(short = 'R', long)] + pub no_dev_only: bool, + + /// Only output what would be changed, do not modify files + #[arg(long)] + pub dry_run: bool, +} + +pub fn execute(_args: &BumpArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/check_platform_reqs.rs b/crates/mozart/src/commands/check_platform_reqs.rs new file mode 100644 index 0000000..697b3f6 --- /dev/null +++ b/crates/mozart/src/commands/check_platform_reqs.rs @@ -0,0 +1,20 @@ +use clap::Args; + +#[derive(Args)] +pub struct CheckPlatformReqsArgs { + /// Disables checking of require-dev packages requirements + #[arg(long)] + pub no_dev: bool, + + /// Check packages from the lock file + #[arg(long)] + pub lock: bool, + + /// Output format (text, json) + #[arg(short, long)] + pub format: Option, +} + +pub fn execute(_args: &CheckPlatformReqsArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/clear_cache.rs b/crates/mozart/src/commands/clear_cache.rs new file mode 100644 index 0000000..051ff4c --- /dev/null +++ b/crates/mozart/src/commands/clear_cache.rs @@ -0,0 +1,12 @@ +use clap::Args; + +#[derive(Args)] +pub struct ClearCacheArgs { + /// Only run garbage collection, not a full cache clear + #[arg(long)] + pub gc: bool, +} + +pub fn execute(_args: &ClearCacheArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/config.rs b/crates/mozart/src/commands/config.rs new file mode 100644 index 0000000..4434840 --- /dev/null +++ b/crates/mozart/src/commands/config.rs @@ -0,0 +1,58 @@ +use clap::Args; + +#[derive(Args)] +pub struct ConfigArgs { + /// Setting key + pub setting_key: Option, + + /// Setting value(s) + pub setting_value: Vec, + + /// Apply to the global config file + #[arg(short, long)] + pub global: bool, + + /// Open the config file in an editor + #[arg(short, long)] + pub editor: bool, + + /// Affect auth config file + #[arg(short, long)] + pub auth: bool, + + /// Unset the given setting key + #[arg(long)] + pub unset: bool, + + /// List the current configuration variables + #[arg(short, long)] + pub list: bool, + + /// Use a specific config file + #[arg(short, long)] + pub file: Option, + + /// Returns absolute paths when fetching *-dir config values + #[arg(long)] + pub absolute: bool, + + /// JSON decode the setting value + #[arg(short, long)] + pub json: bool, + + /// Merge the setting value with the current value + #[arg(short, long)] + pub merge: bool, + + /// Append to existing array values + #[arg(long)] + pub append: bool, + + /// Display the origin of a config setting + #[arg(long)] + pub source: bool, +} + +pub fn execute(_args: &ConfigArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/create_project.rs b/crates/mozart/src/commands/create_project.rs new file mode 100644 index 0000000..814d33b --- /dev/null +++ b/crates/mozart/src/commands/create_project.rs @@ -0,0 +1,105 @@ +use clap::Args; + +#[derive(Args)] +pub struct CreateProjectArgs { + /// Package name to install + pub package: Option, + + /// Directory to create the project in + pub directory: Option, + + /// Version constraint + pub version: Option, + + /// Minimum stability (stable, RC, beta, alpha, dev) + #[arg(short, long)] + pub stability: Option, + + /// Forces installation from package sources when possible + #[arg(long)] + pub prefer_source: bool, + + /// Forces installation from package dist + #[arg(long)] + pub prefer_dist: bool, + + /// Forces usage of a specific install method (dist, source, auto) + #[arg(long)] + pub prefer_install: Option, + + /// Add a custom repository to discover the package + #[arg(long)] + pub repository: Vec, + + /// [Deprecated] Use --repository instead + #[arg(long)] + pub repository_url: Option, + + /// Add the repository to the composer.json + #[arg(long)] + pub add_repository: bool, + + /// Install require-dev packages + #[arg(long)] + pub dev: bool, + + /// Disables installation of require-dev packages + #[arg(long)] + pub no_dev: bool, + + /// [Deprecated] Use --no-plugins instead + #[arg(long)] + pub no_custom_installers: bool, + + /// Skips execution of scripts defined in composer.json + #[arg(long)] + pub no_scripts: bool, + + /// Do not output download progress + #[arg(long)] + pub no_progress: bool, + + /// Disable HTTPS and allow HTTP + #[arg(long)] + pub no_secure_http: bool, + + /// Keep the VCS metadata + #[arg(long)] + pub keep_vcs: bool, + + /// Force removal of the VCS metadata + #[arg(long)] + pub remove_vcs: bool, + + /// Skip the install step after project creation + #[arg(long)] + pub no_install: bool, + + /// Skip the audit step after installation + #[arg(long)] + pub no_audit: bool, + + /// Audit output format + #[arg(long)] + pub audit_format: Option, + + /// Do not block on security advisories + #[arg(long)] + pub no_security_blocking: bool, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, + + /// Interactive package resolution + #[arg(long)] + pub ask: bool, +} + +pub fn execute(_args: &CreateProjectArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/depends.rs b/crates/mozart/src/commands/depends.rs new file mode 100644 index 0000000..33aabc6 --- /dev/null +++ b/crates/mozart/src/commands/depends.rs @@ -0,0 +1,23 @@ +use clap::Args; + +#[derive(Args)] +pub struct DependsArgs { + /// Package to inspect + pub package: String, + + /// Recursively resolve up to the root package + #[arg(short, long)] + pub recursive: bool, + + /// Prints the results as a nested tree + #[arg(short, long)] + pub tree: bool, + + /// Read dependency information from the lock file + #[arg(long)] + pub locked: bool, +} + +pub fn execute(_args: &DependsArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/diagnose.rs b/crates/mozart/src/commands/diagnose.rs new file mode 100644 index 0000000..5a77ba5 --- /dev/null +++ b/crates/mozart/src/commands/diagnose.rs @@ -0,0 +1,8 @@ +use clap::Args; + +#[derive(Args)] +pub struct DiagnoseArgs {} + +pub fn execute(_args: &DiagnoseArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/dump_autoload.rs b/crates/mozart/src/commands/dump_autoload.rs new file mode 100644 index 0000000..0eb20c9 --- /dev/null +++ b/crates/mozart/src/commands/dump_autoload.rs @@ -0,0 +1,52 @@ +use clap::Args; + +#[derive(Args)] +pub struct DumpAutoloadArgs { + /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps + #[arg(short, long)] + pub optimize: bool, + + /// Autoload classes from the classmap only + #[arg(short = 'a', long)] + pub classmap_authoritative: bool, + + /// Use APCu to cache found/not-found classes + #[arg(long)] + pub apcu: bool, + + /// Use a custom prefix for the APCu autoloader cache + #[arg(long)] + pub apcu_prefix: Option, + + /// Only output what would be changed, do not modify files + #[arg(long)] + pub dry_run: bool, + + /// Enables autoload-dev rules + #[arg(long)] + pub dev: bool, + + /// Disables autoload-dev rules + #[arg(long)] + pub no_dev: bool, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, + + /// Return a failed status code if there are PSR mapping errors + #[arg(long)] + pub strict_psr: bool, + + /// Return a failed status code if there are ambiguous class mappings + #[arg(long)] + pub strict_ambiguous: bool, +} + +pub fn execute(_args: &DumpAutoloadArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/exec.rs b/crates/mozart/src/commands/exec.rs new file mode 100644 index 0000000..7635058 --- /dev/null +++ b/crates/mozart/src/commands/exec.rs @@ -0,0 +1,19 @@ +use clap::Args; + +#[derive(Args)] +pub struct ExecArgs { + /// The binary to run + pub binary: Option, + + /// Arguments to pass to the binary + #[arg(trailing_var_arg = true)] + pub args: Vec, + + /// List the available binaries + #[arg(short, long)] + pub list: bool, +} + +pub fn execute(_args: &ExecArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/fund.rs b/crates/mozart/src/commands/fund.rs new file mode 100644 index 0000000..bd82306 --- /dev/null +++ b/crates/mozart/src/commands/fund.rs @@ -0,0 +1,12 @@ +use clap::Args; + +#[derive(Args)] +pub struct FundArgs { + /// Output format (text, json) + #[arg(short, long)] + pub format: Option, +} + +pub fn execute(_args: &FundArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/global.rs b/crates/mozart/src/commands/global.rs new file mode 100644 index 0000000..c4de5e4 --- /dev/null +++ b/crates/mozart/src/commands/global.rs @@ -0,0 +1,15 @@ +use clap::Args; + +#[derive(Args)] +pub struct GlobalArgs { + /// The command name to run + pub command_name: String, + + /// Arguments to pass to the command + #[arg(trailing_var_arg = true)] + pub args: Vec, +} + +pub fn execute(_args: &GlobalArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/init.rs b/crates/mozart/src/commands/init.rs new file mode 100644 index 0000000..059e494 --- /dev/null +++ b/crates/mozart/src/commands/init.rs @@ -0,0 +1,52 @@ +use clap::Args; + +#[derive(Args)] +pub struct InitArgs { + /// Name of the package (vendor/name) + #[arg(long)] + pub name: Option, + + /// Description of the package + #[arg(long)] + pub description: Option, + + /// Author name of the package + #[arg(long)] + pub author: Option, + + /// Type of the package + #[arg(long, value_name = "TYPE")] + pub r#type: Option, + + /// Homepage of the package + #[arg(long)] + pub homepage: Option, + + /// Package(s) to require + #[arg(long)] + pub require: Vec, + + /// Package(s) to require for development + #[arg(long)] + pub require_dev: Vec, + + /// Minimum stability (stable, RC, beta, alpha, dev) + #[arg(short, long)] + pub stability: Option, + + /// License of the package + #[arg(short, long)] + pub license: Option, + + /// Add a custom repository + #[arg(long)] + pub repository: Vec, + + /// Define a PSR-4 autoload namespace + #[arg(short, long)] + pub autoload: Option, +} + +pub fn execute(_args: &InitArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs new file mode 100644 index 0000000..e839e96 --- /dev/null +++ b/crates/mozart/src/commands/install.rs @@ -0,0 +1,91 @@ +use clap::Args; + +#[derive(Args)] +pub struct InstallArgs { + /// Package(s) to install + pub packages: Vec, + + /// Forces installation from package sources when possible + #[arg(long)] + pub prefer_source: bool, + + /// Forces installation from package dist + #[arg(long)] + pub prefer_dist: bool, + + /// Forces usage of a specific install method (dist, source, auto) + #[arg(long)] + pub prefer_install: Option, + + /// Only output what would be changed, do not modify files + #[arg(long)] + pub dry_run: bool, + + /// Only download packages, do not install + #[arg(long)] + pub download_only: bool, + + /// [Deprecated] Enables installation of require-dev packages + #[arg(long)] + pub dev: bool, + + /// Disables installation of require-dev packages + #[arg(long)] + pub no_dev: bool, + + /// Do not block on security advisories + #[arg(long)] + pub no_security_blocking: bool, + + /// Skips autoloader generation + #[arg(long)] + pub no_autoloader: bool, + + /// Do not output download progress + #[arg(long)] + pub no_progress: bool, + + /// Skip the install step + #[arg(long)] + pub no_install: bool, + + /// [Deprecated] Do not show install suggestions + #[arg(long)] + pub no_suggest: bool, + + /// Run audit after installation + #[arg(long)] + pub audit: bool, + + /// Audit output format + #[arg(long)] + pub audit_format: Option, + + /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps + #[arg(short, long)] + pub optimize_autoloader: bool, + + /// Autoload classes from the classmap only + #[arg(short = 'a', long)] + pub classmap_authoritative: bool, + + /// Use APCu to cache found/not-found classes + #[arg(long)] + pub apcu_autoloader: bool, + + /// Use a custom prefix for the APCu autoloader cache + #[arg(long)] + pub apcu_autoloader_prefix: Option, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, +} + +pub fn execute(_args: &InstallArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/licenses.rs b/crates/mozart/src/commands/licenses.rs new file mode 100644 index 0000000..d9b0caf --- /dev/null +++ b/crates/mozart/src/commands/licenses.rs @@ -0,0 +1,20 @@ +use clap::Args; + +#[derive(Args)] +pub struct LicensesArgs { + /// Output format (text, json, summary) + #[arg(short, long)] + pub format: Option, + + /// Disables listing of require-dev packages + #[arg(long)] + pub no_dev: bool, + + /// List packages from the lock file + #[arg(long)] + pub locked: bool, +} + +pub fn execute(_args: &LicensesArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/outdated.rs b/crates/mozart/src/commands/outdated.rs new file mode 100644 index 0000000..3bbb451 --- /dev/null +++ b/crates/mozart/src/commands/outdated.rs @@ -0,0 +1,67 @@ +use clap::Args; + +#[derive(Args)] +pub struct OutdatedArgs { + /// Package to inspect + pub package: Option, + + /// Show only packages that are outdated + #[arg(short, long)] + pub outdated: bool, + + /// Show all installed packages + #[arg(short, long)] + pub all: bool, + + /// Show packages from the lock file + #[arg(long)] + pub locked: bool, + + /// Shows only packages that are directly required by the root package + #[arg(short = 'D', long)] + pub direct: bool, + + /// Return a non-zero exit code when there are outdated packages + #[arg(long)] + pub strict: bool, + + /// Only show packages that have major SemVer-compatible updates + #[arg(short = 'M', long)] + pub major_only: bool, + + /// Only show packages that have minor SemVer-compatible updates + #[arg(short = 'm', long)] + pub minor_only: bool, + + /// Only show packages that have patch SemVer-compatible updates + #[arg(short = 'p', long)] + pub patch_only: bool, + + /// Sort packages by age of the last update + #[arg(short = 'A', long)] + pub sort_by_age: bool, + + /// Output format (text, json) + #[arg(short, long)] + pub format: Option, + + /// Ignore specified package(s) + #[arg(long)] + pub ignore: Vec, + + /// Disables listing of require-dev packages + #[arg(long)] + pub no_dev: bool, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, +} + +pub fn execute(_args: &OutdatedArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/prohibits.rs b/crates/mozart/src/commands/prohibits.rs new file mode 100644 index 0000000..aff1ee0 --- /dev/null +++ b/crates/mozart/src/commands/prohibits.rs @@ -0,0 +1,26 @@ +use clap::Args; + +#[derive(Args)] +pub struct ProhibitsArgs { + /// Package to inspect + pub package: String, + + /// Version constraint + pub version: String, + + /// Recursively resolve up to the root package + #[arg(short, long)] + pub recursive: bool, + + /// Prints the results as a nested tree + #[arg(short, long)] + pub tree: bool, + + /// Read dependency information from the lock file + #[arg(long)] + pub locked: bool, +} + +pub fn execute(_args: &ProhibitsArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/reinstall.rs b/crates/mozart/src/commands/reinstall.rs new file mode 100644 index 0000000..08aad44 --- /dev/null +++ b/crates/mozart/src/commands/reinstall.rs @@ -0,0 +1,59 @@ +use clap::Args; + +#[derive(Args)] +pub struct ReinstallArgs { + /// Package(s) to reinstall + pub packages: Vec, + + /// Forces installation from package sources when possible + #[arg(long)] + pub prefer_source: bool, + + /// Forces installation from package dist + #[arg(long)] + pub prefer_dist: bool, + + /// Forces usage of a specific install method (dist, source, auto) + #[arg(long)] + pub prefer_install: Option, + + /// Skips autoloader generation + #[arg(long)] + pub no_autoloader: bool, + + /// Do not output download progress + #[arg(long)] + pub no_progress: bool, + + /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps + #[arg(short, long)] + pub optimize_autoloader: bool, + + /// Autoload classes from the classmap only + #[arg(short = 'a', long)] + pub classmap_authoritative: bool, + + /// Use APCu to cache found/not-found classes + #[arg(long)] + pub apcu_autoloader: bool, + + /// Use a custom prefix for the APCu autoloader cache + #[arg(long)] + pub apcu_autoloader_prefix: Option, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, + + /// Filter packages to reinstall by type + #[arg(long, value_name = "TYPE")] + pub r#type: Vec, +} + +pub fn execute(_args: &ReinstallArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/remove.rs b/crates/mozart/src/commands/remove.rs new file mode 100644 index 0000000..b444a66 --- /dev/null +++ b/crates/mozart/src/commands/remove.rs @@ -0,0 +1,95 @@ +use clap::Args; + +#[derive(Args)] +pub struct RemoveArgs { + /// Package(s) to remove + pub packages: Vec, + + /// Remove from require-dev + #[arg(long)] + pub dev: bool, + + /// Only output what would be changed, do not modify files + #[arg(long)] + pub dry_run: bool, + + /// Do not output download progress + #[arg(long)] + pub no_progress: bool, + + /// Disables the automatic update of the lock file + #[arg(long)] + pub no_update: bool, + + /// Skip the install step + #[arg(long)] + pub no_install: bool, + + /// Skip the audit step + #[arg(long)] + pub no_audit: bool, + + /// Audit output format + #[arg(long)] + pub audit_format: Option, + + /// Do not block on security advisories + #[arg(long)] + pub no_security_blocking: bool, + + /// Run the dependency update with the --no-dev option + #[arg(long)] + pub update_no_dev: bool, + + /// [Deprecated] Use --with-all-dependencies instead + #[arg(short = 'w', long)] + pub update_with_dependencies: bool, + + /// [Deprecated] Use --with-all-dependencies instead + #[arg(short = 'W', long)] + pub update_with_all_dependencies: bool, + + /// Update also dependencies of the removed packages + #[arg(long)] + pub with_all_dependencies: bool, + + /// Skip updating dependencies + #[arg(long)] + pub no_update_with_dependencies: bool, + + /// Prefer minimal restriction updates + #[arg(short = 'm', long)] + pub minimal_changes: bool, + + /// Remove unused packages + #[arg(long)] + pub unused: bool, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, + + /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps + #[arg(short, long)] + pub optimize_autoloader: bool, + + /// Autoload classes from the classmap only + #[arg(short = 'a', long)] + pub classmap_authoritative: bool, + + /// Use APCu to cache found/not-found classes + #[arg(long)] + pub apcu_autoloader: bool, + + /// Use a custom prefix for the APCu autoloader cache + #[arg(long)] + pub apcu_autoloader_prefix: Option, +} + +pub fn execute(_args: &RemoveArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/repository.rs b/crates/mozart/src/commands/repository.rs new file mode 100644 index 0000000..8646c06 --- /dev/null +++ b/crates/mozart/src/commands/repository.rs @@ -0,0 +1,40 @@ +use clap::Args; + +#[derive(Args)] +pub struct RepositoryArgs { + /// Action (list, add, remove, set-url, get-url, enable, disable) + pub action: Option, + + /// Repository name + pub name: Option, + + /// Argument 1 (URL or type depending on action) + pub arg1: Option, + + /// Argument 2 + pub arg2: Option, + + /// Apply to the global config file + #[arg(short, long)] + pub global: bool, + + /// Use a specific config file + #[arg(short, long)] + pub file: Option, + + /// Append the repository instead of prepending it + #[arg(long)] + pub append: bool, + + /// Add before a specific repository + #[arg(long)] + pub before: Option, + + /// Add after a specific repository + #[arg(long)] + pub after: Option, +} + +pub fn execute(_args: &RepositoryArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/require.rs b/crates/mozart/src/commands/require.rs new file mode 100644 index 0000000..3b8cceb --- /dev/null +++ b/crates/mozart/src/commands/require.rs @@ -0,0 +1,123 @@ +use clap::Args; + +#[derive(Args)] +pub struct RequireArgs { + /// Package(s) to require + pub packages: Vec, + + /// Add requirement to require-dev + #[arg(long)] + pub dev: bool, + + /// Only output what would be changed, do not modify files + #[arg(long)] + pub dry_run: bool, + + /// Forces installation from package sources when possible + #[arg(long)] + pub prefer_source: bool, + + /// Forces installation from package dist + #[arg(long)] + pub prefer_dist: bool, + + /// Forces usage of a specific install method (dist, source, auto) + #[arg(long)] + pub prefer_install: Option, + + /// Pin the exact version instead of a range + #[arg(long)] + pub fixed: bool, + + /// [Deprecated] Do not show install suggestions + #[arg(long)] + pub no_suggest: bool, + + /// Do not output download progress + #[arg(long)] + pub no_progress: bool, + + /// Disables the automatic update of the lock file + #[arg(long)] + pub no_update: bool, + + /// Skip the install step + #[arg(long)] + pub no_install: bool, + + /// Skip the audit step + #[arg(long)] + pub no_audit: bool, + + /// Audit output format + #[arg(long)] + pub audit_format: Option, + + /// Do not block on security advisories + #[arg(long)] + pub no_security_blocking: bool, + + /// Run the dependency update with the --no-dev option + #[arg(long)] + pub update_no_dev: bool, + + /// [Deprecated] Use --with-dependencies instead + #[arg(short = 'w', long)] + pub update_with_dependencies: bool, + + /// [Deprecated] Use --with-all-dependencies instead + #[arg(short = 'W', long)] + pub update_with_all_dependencies: bool, + + /// Update also dependencies of newly required packages + #[arg(long)] + pub with_dependencies: bool, + + /// Update all dependencies including root requirements + #[arg(long)] + pub with_all_dependencies: bool, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, + + /// Prefer stable versions of dependencies + #[arg(long)] + pub prefer_stable: bool, + + /// Prefer lowest versions of dependencies + #[arg(long)] + pub prefer_lowest: bool, + + /// Prefer minimal restriction updates + #[arg(short = 'm', long)] + pub minimal_changes: bool, + + /// Sort packages in composer.json + #[arg(long)] + pub sort_packages: bool, + + /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps + #[arg(short, long)] + pub optimize_autoloader: bool, + + /// Autoload classes from the classmap only + #[arg(short = 'a', long)] + pub classmap_authoritative: bool, + + /// Use APCu to cache found/not-found classes + #[arg(long)] + pub apcu_autoloader: bool, + + /// Use a custom prefix for the APCu autoloader cache + #[arg(long)] + pub apcu_autoloader_prefix: Option, +} + +pub fn execute(_args: &RequireArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/run_script.rs b/crates/mozart/src/commands/run_script.rs new file mode 100644 index 0000000..e2349a2 --- /dev/null +++ b/crates/mozart/src/commands/run_script.rs @@ -0,0 +1,31 @@ +use clap::Args; + +#[derive(Args)] +pub struct RunScriptArgs { + /// Script name to run + pub script: Option, + + /// Arguments to pass to the script + #[arg(trailing_var_arg = true)] + pub args: Vec, + + /// Set the script timeout in seconds + #[arg(long)] + pub timeout: Option, + + /// Sets the dev mode + #[arg(long)] + pub dev: bool, + + /// Disables the dev mode + #[arg(long)] + pub no_dev: bool, + + /// List the available scripts + #[arg(short, long)] + pub list: bool, +} + +pub fn execute(_args: &RunScriptArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/search.rs b/crates/mozart/src/commands/search.rs new file mode 100644 index 0000000..3d2d20f --- /dev/null +++ b/crates/mozart/src/commands/search.rs @@ -0,0 +1,28 @@ +use clap::Args; + +#[derive(Args)] +pub struct SearchArgs { + /// Search tokens + #[arg(required = true)] + pub tokens: Vec, + + /// Search only in name + #[arg(short = 'N', long)] + pub only_name: bool, + + /// Search only for vendor / organization + #[arg(short = 'O', long)] + pub only_vendor: bool, + + /// Filter by package type + #[arg(short, long, value_name = "TYPE")] + pub r#type: Option, + + /// Output format (text, json) + #[arg(short, long)] + pub format: Option, +} + +pub fn execute(_args: &SearchArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/self_update.rs b/crates/mozart/src/commands/self_update.rs new file mode 100644 index 0000000..3497d7d --- /dev/null +++ b/crates/mozart/src/commands/self_update.rs @@ -0,0 +1,55 @@ +use clap::Args; + +#[derive(Args)] +pub struct SelfUpdateArgs { + /// Version to update to + pub version: Option, + + /// Revert to a previous version + #[arg(short, long)] + pub rollback: bool, + + /// Delete old backups during self-update + #[arg(long)] + pub clean_backups: bool, + + /// Do not output download progress + #[arg(long)] + pub no_progress: bool, + + /// Prompt user for a key update + #[arg(long)] + pub update_keys: bool, + + /// Force update to the stable channel + #[arg(long)] + pub stable: bool, + + /// Force update to the preview channel + #[arg(long)] + pub preview: bool, + + /// Force update to the snapshot channel + #[arg(long)] + pub snapshot: bool, + + /// Force update to the 1.x channel + #[arg(long = "1")] + pub channel_1: bool, + + /// Force update to the 2.x channel + #[arg(long = "2")] + pub channel_2: bool, + + /// Force update to the 2.2.x LTS channel + #[arg(long = "2.2")] + pub channel_2_2: bool, + + /// Only store the channel as default and skip the update + #[arg(long)] + pub set_channel_only: bool, +} + +pub fn execute(_args: &SelfUpdateArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/show.rs b/crates/mozart/src/commands/show.rs new file mode 100644 index 0000000..290a8dd --- /dev/null +++ b/crates/mozart/src/commands/show.rs @@ -0,0 +1,102 @@ +use clap::Args; + +#[derive(Args)] +pub struct ShowArgs { + /// Package to inspect + pub package: Option, + + /// Version constraint + pub version: Option, + + /// List all packages + #[arg(long)] + pub all: bool, + + /// List packages from the lock file + #[arg(long)] + pub locked: bool, + + /// Show only installed packages (enabled by default) + #[arg(short, long)] + pub installed: bool, + + /// List platform packages only + #[arg(short, long)] + pub platform: bool, + + /// List available packages only + #[arg(short = 'a', long)] + pub available: bool, + + /// Show information about the root package + #[arg(short, long, name = "self")] + pub self_info: bool, + + /// Show package names only + #[arg(short = 'N', long)] + pub name_only: bool, + + /// Show package paths only + #[arg(short = 'P', long)] + pub path: bool, + + /// List the dependencies as a tree + #[arg(short, long)] + pub tree: bool, + + /// Show the latest version + #[arg(short, long)] + pub latest: bool, + + /// Show only packages that are outdated + #[arg(short, long)] + pub outdated: bool, + + /// Ignore specified package(s) + #[arg(long)] + pub ignore: Vec, + + /// Only show packages that have major SemVer-compatible updates + #[arg(short = 'M', long)] + pub major_only: bool, + + /// Only show packages that have minor SemVer-compatible updates + #[arg(short = 'm', long)] + pub minor_only: bool, + + /// Only show packages that have patch SemVer-compatible updates + #[arg(long)] + pub patch_only: bool, + + /// Sort packages by age of the last update + #[arg(short = 'A', long)] + pub sort_by_age: bool, + + /// Shows only packages that are directly required by the root package + #[arg(short = 'D', long)] + pub direct: bool, + + /// Return a non-zero exit code when there are outdated packages + #[arg(long)] + pub strict: bool, + + /// Output format (text, json) + #[arg(short, long)] + pub format: Option, + + /// Disables listing of require-dev packages + #[arg(long)] + pub no_dev: bool, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, +} + +pub fn execute(_args: &ShowArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/status.rs b/crates/mozart/src/commands/status.rs new file mode 100644 index 0000000..424f404 --- /dev/null +++ b/crates/mozart/src/commands/status.rs @@ -0,0 +1,8 @@ +use clap::Args; + +#[derive(Args)] +pub struct StatusArgs {} + +pub fn execute(_args: &StatusArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/suggests.rs b/crates/mozart/src/commands/suggests.rs new file mode 100644 index 0000000..6a80501 --- /dev/null +++ b/crates/mozart/src/commands/suggests.rs @@ -0,0 +1,31 @@ +use clap::Args; + +#[derive(Args)] +pub struct SuggestsArgs { + /// Package(s) to list suggestions for + pub packages: Vec, + + /// Group output by package + #[arg(long)] + pub by_package: bool, + + /// Group output by suggestion + #[arg(long)] + pub by_suggestion: bool, + + /// Show suggestions for all packages, not just root + #[arg(short, long)] + pub all: bool, + + /// Show only suggested package names in list format + #[arg(long)] + pub list: bool, + + /// Disables suggestions from require-dev packages + #[arg(long)] + pub no_dev: bool, +} + +pub fn execute(_args: &SuggestsArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/update.rs b/crates/mozart/src/commands/update.rs new file mode 100644 index 0000000..0f1257c --- /dev/null +++ b/crates/mozart/src/commands/update.rs @@ -0,0 +1,131 @@ +use clap::Args; + +#[derive(Args)] +pub struct UpdateArgs { + /// Package(s) to update + pub packages: Vec, + + /// Temporary version constraint overrides + #[arg(long)] + pub with: Vec, + + /// Forces installation from package sources when possible + #[arg(long)] + pub prefer_source: bool, + + /// Forces installation from package dist + #[arg(long)] + pub prefer_dist: bool, + + /// Forces usage of a specific install method (dist, source, auto) + #[arg(long)] + pub prefer_install: Option, + + /// Only output what would be changed, do not modify files + #[arg(long)] + pub dry_run: bool, + + /// [Deprecated] Enables installation of require-dev packages + #[arg(long)] + pub dev: bool, + + /// Disables installation of require-dev packages + #[arg(long)] + pub no_dev: bool, + + /// Only updates the lock file hash + #[arg(long)] + pub lock: bool, + + /// Skip the install step + #[arg(long)] + pub no_install: bool, + + /// Skip the audit step + #[arg(long)] + pub no_audit: bool, + + /// Audit output format + #[arg(long)] + pub audit_format: Option, + + /// Do not block on security advisories + #[arg(long)] + pub no_security_blocking: bool, + + /// Skips autoloader generation + #[arg(long)] + pub no_autoloader: bool, + + /// [Deprecated] Do not show install suggestions + #[arg(long)] + pub no_suggest: bool, + + /// Do not output download progress + #[arg(long)] + pub no_progress: bool, + + /// Update also dependencies of packages in the argument list + #[arg(short = 'w', long)] + pub with_dependencies: bool, + + /// Update also all dependencies including root requirements + #[arg(short = 'W', long)] + pub with_all_dependencies: bool, + + /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps + #[arg(short, long)] + pub optimize_autoloader: bool, + + /// Autoload classes from the classmap only + #[arg(short = 'a', long)] + pub classmap_authoritative: bool, + + /// Use APCu to cache found/not-found classes + #[arg(long)] + pub apcu_autoloader: bool, + + /// Use a custom prefix for the APCu autoloader cache + #[arg(long)] + pub apcu_autoloader_prefix: Option, + + /// Ignore a specific platform requirement + #[arg(long)] + pub ignore_platform_req: Vec, + + /// Ignore all platform requirements + #[arg(long)] + pub ignore_platform_reqs: bool, + + /// Prefer stable versions of dependencies + #[arg(long)] + pub prefer_stable: bool, + + /// Prefer lowest versions of dependencies + #[arg(long)] + pub prefer_lowest: bool, + + /// Prefer minimal restriction updates + #[arg(short = 'm', long)] + pub minimal_changes: bool, + + /// Only allow patch version updates + #[arg(long)] + pub patch_only: bool, + + /// Interactive package selection + #[arg(short, long)] + pub interactive: bool, + + /// Only update packages that are root requirements + #[arg(long)] + pub root_reqs: bool, + + /// Bump version constraints after update (dev, no-dev, all) + #[arg(long)] + pub bump_after_update: Option>, +} + +pub fn execute(_args: &UpdateArgs) { + todo!() +} diff --git a/crates/mozart/src/commands/validate.rs b/crates/mozart/src/commands/validate.rs new file mode 100644 index 0000000..b76d479 --- /dev/null +++ b/crates/mozart/src/commands/validate.rs @@ -0,0 +1,39 @@ +use clap::Args; + +#[derive(Args)] +pub struct ValidateArgs { + /// Path to composer.json file + pub file: Option, + + /// Skips checks for non-essential issues + #[arg(long)] + pub no_check_all: bool, + + /// Validates the lock file + #[arg(long)] + pub check_lock: bool, + + /// Skips lock file validation + #[arg(long)] + pub no_check_lock: bool, + + /// Skips publish-related checks + #[arg(long)] + pub no_check_publish: bool, + + /// Skips version constraint checks + #[arg(long)] + pub no_check_version: bool, + + /// Also validate all dependencies + #[arg(short = 'A', long)] + pub with_dependencies: bool, + + /// Return a non-zero exit code on warnings as well as errors + #[arg(long)] + pub strict: bool, +} + +pub fn execute(_args: &ValidateArgs) { + todo!() +} diff --git a/crates/mozart/src/lib.rs b/crates/mozart/src/lib.rs new file mode 100644 index 0000000..82b6da3 --- /dev/null +++ b/crates/mozart/src/lib.rs @@ -0,0 +1 @@ +pub mod commands; diff --git a/crates/mozart/src/main.rs b/crates/mozart/src/main.rs new file mode 100644 index 0000000..289d047 --- /dev/null +++ b/crates/mozart/src/main.rs @@ -0,0 +1,7 @@ +use clap::Parser; +use mozart::commands; + +fn main() { + let cli = commands::Cli::parse(); + commands::execute(&cli.command); +} diff --git a/src/commands.rs b/src/commands.rs deleted file mode 100644 index f31dd44..0000000 --- a/src/commands.rs +++ /dev/null @@ -1,230 +0,0 @@ -pub mod about; -pub mod archive; -pub mod audit; -pub mod browse; -pub mod bump; -pub mod check_platform_reqs; -pub mod clear_cache; -pub mod config; -pub mod create_project; -pub mod depends; -pub mod diagnose; -pub mod dump_autoload; -pub mod exec; -pub mod fund; -pub mod global; -pub mod init; -pub mod install; -pub mod licenses; -pub mod outdated; -pub mod prohibits; -pub mod reinstall; -pub mod remove; -pub mod repository; -pub mod require; -pub mod run_script; -pub mod search; -pub mod self_update; -pub mod show; -pub mod status; -pub mod suggests; -pub mod update; -pub mod validate; - -#[derive(clap::Parser)] -#[command(name = "mozart", version, about = "A PHP dependency manager")] -pub struct Cli { - #[command(subcommand)] - pub command: Commands, - - /// Increase the verbosity of messages: 1 for normal, 2 for more verbose, 3 for debug - #[arg(short, long, action = clap::ArgAction::Count, global = true)] - pub verbose: u8, - - /// Display timing and memory usage information - #[arg(long, global = true)] - pub profile: bool, - - /// Disables all plugins - #[arg(long, global = true)] - pub no_plugins: bool, - - /// Skips execution of all scripts defined in composer.json - #[arg(long, global = true)] - pub no_scripts: bool, - - /// If specified, use the given directory as working directory - #[arg(short = 'd', long = "working-dir", global = true)] - pub working_dir: Option, - - /// Prevent use of the cache - #[arg(long, global = true)] - pub no_cache: bool, - - /// Do not ask any interactive question - #[arg(short = 'n', long, global = true)] - pub no_interaction: bool, - - /// Do not output any message - #[arg(short, long, global = true)] - pub quiet: bool, - - /// Force ANSI output - #[arg(long, global = true)] - pub ansi: bool, - - /// Disable ANSI output - #[arg(long, global = true)] - pub no_ansi: bool, -} - -#[derive(clap::Subcommand)] -pub enum Commands { - /// Short information about Composer - About(about::AboutArgs), - - /// Creates an archive of this composer package - Archive(archive::ArchiveArgs), - - /// Checks for security vulnerability advisories for installed packages - Audit(audit::AuditArgs), - - /// Opens the package's repository URL or homepage in your browser - #[command(alias = "home")] - Browse(browse::BrowseArgs), - - /// Increases the lower limit of your package version constraints - Bump(bump::BumpArgs), - - /// Check that platform requirements are satisfied - #[command(name = "check-platform-reqs")] - CheckPlatformReqs(check_platform_reqs::CheckPlatformReqsArgs), - - /// Clears Composer's internal package cache - #[command(name = "clear-cache", alias = "clearcache", alias = "cc")] - ClearCache(clear_cache::ClearCacheArgs), - - /// Sets config options - Config(config::ConfigArgs), - - /// Creates new project from a package into given directory - #[command(name = "create-project")] - CreateProject(create_project::CreateProjectArgs), - - /// Shows which packages cause the given package to be installed - #[command(alias = "why")] - Depends(depends::DependsArgs), - - /// Diagnoses the system to identify common errors - Diagnose(diagnose::DiagnoseArgs), - - /// Dumps the autoloader - #[command(name = "dump-autoload", alias = "dumpautoload")] - DumpAutoload(dump_autoload::DumpAutoloadArgs), - - /// Executes a vendored binary/script - Exec(exec::ExecArgs), - - /// Discover how to help fund the maintenance of your dependencies - Fund(fund::FundArgs), - - /// Allows running commands in the global Composer dir - Global(global::GlobalArgs), - - /// Creates a basic composer.json file in current directory - Init(init::InitArgs), - - /// Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json - #[command(alias = "i")] - Install(install::InstallArgs), - - /// Shows information about licenses of dependencies - Licenses(licenses::LicensesArgs), - - /// Shows a list of installed packages that have updates available - Outdated(outdated::OutdatedArgs), - - /// Shows which packages prevent the given package from being installed - #[command(alias = "why-not")] - Prohibits(prohibits::ProhibitsArgs), - - /// Uninstalls and reinstalls the given package names - Reinstall(reinstall::ReinstallArgs), - - /// Removes a package from the require or require-dev - #[command(alias = "rm", alias = "uninstall")] - Remove(remove::RemoveArgs), - - /// Manage repositories - #[command(alias = "repo")] - Repository(repository::RepositoryArgs), - - /// Adds required packages to your composer.json and installs them - #[command(alias = "r")] - Require(require::RequireArgs), - - /// Runs the scripts defined in composer.json - #[command(name = "run-script", alias = "run")] - RunScript(run_script::RunScriptArgs), - - /// Searches for packages - Search(search::SearchArgs), - - /// Updates Composer to the latest version - #[command(name = "self-update", alias = "selfupdate")] - SelfUpdate(self_update::SelfUpdateArgs), - - /// Shows information about packages - #[command(alias = "info")] - Show(show::ShowArgs), - - /// Shows a list of locally modified packages - Status(status::StatusArgs), - - /// Shows package suggestions - Suggests(suggests::SuggestsArgs), - - /// Updates your dependencies to the latest version according to composer.json - #[command(alias = "u", alias = "upgrade")] - Update(update::UpdateArgs), - - /// Validates a composer.json and composer.lock - Validate(validate::ValidateArgs), -} - -pub fn execute(command: &Commands) { - match command { - Commands::About(args) => about::execute(args), - Commands::Archive(args) => archive::execute(args), - Commands::Audit(args) => audit::execute(args), - Commands::Browse(args) => browse::execute(args), - Commands::Bump(args) => bump::execute(args), - Commands::CheckPlatformReqs(args) => check_platform_reqs::execute(args), - Commands::ClearCache(args) => clear_cache::execute(args), - Commands::Config(args) => config::execute(args), - Commands::CreateProject(args) => create_project::execute(args), - Commands::Depends(args) => depends::execute(args), - Commands::Diagnose(args) => diagnose::execute(args), - Commands::DumpAutoload(args) => dump_autoload::execute(args), - Commands::Exec(args) => exec::execute(args), - Commands::Fund(args) => fund::execute(args), - Commands::Global(args) => global::execute(args), - Commands::Init(args) => init::execute(args), - Commands::Install(args) => install::execute(args), - Commands::Licenses(args) => licenses::execute(args), - Commands::Outdated(args) => outdated::execute(args), - Commands::Prohibits(args) => prohibits::execute(args), - Commands::Reinstall(args) => reinstall::execute(args), - Commands::Remove(args) => remove::execute(args), - Commands::Repository(args) => repository::execute(args), - Commands::Require(args) => require::execute(args), - Commands::RunScript(args) => run_script::execute(args), - Commands::Search(args) => search::execute(args), - Commands::SelfUpdate(args) => self_update::execute(args), - Commands::Show(args) => show::execute(args), - Commands::Status(args) => status::execute(args), - Commands::Suggests(args) => suggests::execute(args), - Commands::Update(args) => update::execute(args), - Commands::Validate(args) => validate::execute(args), - } -} diff --git a/src/commands/about.rs b/src/commands/about.rs deleted file mode 100644 index 833b6c8..0000000 --- a/src/commands/about.rs +++ /dev/null @@ -1,8 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct AboutArgs {} - -pub fn execute(_args: &AboutArgs) { - todo!() -} diff --git a/src/commands/archive.rs b/src/commands/archive.rs deleted file mode 100644 index 1fbef6c..0000000 --- a/src/commands/archive.rs +++ /dev/null @@ -1,30 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ArchiveArgs { - /// The package name - pub package: Option, - - /// A version constraint - pub version: Option, - - /// Format of the resulting archive (tar, tar.gz, tar.bz2, zip) - #[arg(short, long)] - pub format: Option, - - /// Write the archive to this directory - #[arg(long)] - pub dir: Option, - - /// Write the archive with the given file name - #[arg(long)] - pub file: Option, - - /// Ignore filters when saving archive - #[arg(long)] - pub ignore_filters: bool, -} - -pub fn execute(_args: &ArchiveArgs) { - todo!() -} diff --git a/src/commands/audit.rs b/src/commands/audit.rs deleted file mode 100644 index 02b0d8d..0000000 --- a/src/commands/audit.rs +++ /dev/null @@ -1,32 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct AuditArgs { - /// Disables installation of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// Output format (table, plain, json, summary) - #[arg(short, long, default_value = "table")] - pub format: String, - - /// Audit packages from the lock file - #[arg(long)] - pub locked: bool, - - /// Handling of abandoned packages (ignore, report, fail) - #[arg(long)] - pub abandoned: Option, - - /// Ignore advisories of a given severity (low, medium, high, critical) - #[arg(long)] - pub ignore_severity: Vec, - - /// Ignore advisories from sources that are unreachable - #[arg(long)] - pub ignore_unreachable: bool, -} - -pub fn execute(_args: &AuditArgs) { - todo!() -} diff --git a/src/commands/browse.rs b/src/commands/browse.rs deleted file mode 100644 index b6cb08f..0000000 --- a/src/commands/browse.rs +++ /dev/null @@ -1,19 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct BrowseArgs { - /// Package(s) to browse - pub packages: Vec, - - /// Open the homepage instead of the repository URL - #[arg(short = 'H', long)] - pub homepage: bool, - - /// Only show the homepage or repository URL - #[arg(short, long)] - pub show: bool, -} - -pub fn execute(_args: &BrowseArgs) { - todo!() -} diff --git a/src/commands/bump.rs b/src/commands/bump.rs deleted file mode 100644 index 40e01f1..0000000 --- a/src/commands/bump.rs +++ /dev/null @@ -1,23 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct BumpArgs { - /// Package(s) to bump - pub packages: Vec, - - /// Only bump packages in require-dev - #[arg(short = 'D', long)] - pub dev_only: bool, - - /// Only bump packages in require - #[arg(short = 'R', long)] - pub no_dev_only: bool, - - /// Only output what would be changed, do not modify files - #[arg(long)] - pub dry_run: bool, -} - -pub fn execute(_args: &BumpArgs) { - todo!() -} diff --git a/src/commands/check_platform_reqs.rs b/src/commands/check_platform_reqs.rs deleted file mode 100644 index 697b3f6..0000000 --- a/src/commands/check_platform_reqs.rs +++ /dev/null @@ -1,20 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct CheckPlatformReqsArgs { - /// Disables checking of require-dev packages requirements - #[arg(long)] - pub no_dev: bool, - - /// Check packages from the lock file - #[arg(long)] - pub lock: bool, - - /// Output format (text, json) - #[arg(short, long)] - pub format: Option, -} - -pub fn execute(_args: &CheckPlatformReqsArgs) { - todo!() -} diff --git a/src/commands/clear_cache.rs b/src/commands/clear_cache.rs deleted file mode 100644 index 051ff4c..0000000 --- a/src/commands/clear_cache.rs +++ /dev/null @@ -1,12 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ClearCacheArgs { - /// Only run garbage collection, not a full cache clear - #[arg(long)] - pub gc: bool, -} - -pub fn execute(_args: &ClearCacheArgs) { - todo!() -} diff --git a/src/commands/config.rs b/src/commands/config.rs deleted file mode 100644 index 4434840..0000000 --- a/src/commands/config.rs +++ /dev/null @@ -1,58 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ConfigArgs { - /// Setting key - pub setting_key: Option, - - /// Setting value(s) - pub setting_value: Vec, - - /// Apply to the global config file - #[arg(short, long)] - pub global: bool, - - /// Open the config file in an editor - #[arg(short, long)] - pub editor: bool, - - /// Affect auth config file - #[arg(short, long)] - pub auth: bool, - - /// Unset the given setting key - #[arg(long)] - pub unset: bool, - - /// List the current configuration variables - #[arg(short, long)] - pub list: bool, - - /// Use a specific config file - #[arg(short, long)] - pub file: Option, - - /// Returns absolute paths when fetching *-dir config values - #[arg(long)] - pub absolute: bool, - - /// JSON decode the setting value - #[arg(short, long)] - pub json: bool, - - /// Merge the setting value with the current value - #[arg(short, long)] - pub merge: bool, - - /// Append to existing array values - #[arg(long)] - pub append: bool, - - /// Display the origin of a config setting - #[arg(long)] - pub source: bool, -} - -pub fn execute(_args: &ConfigArgs) { - todo!() -} diff --git a/src/commands/create_project.rs b/src/commands/create_project.rs deleted file mode 100644 index 814d33b..0000000 --- a/src/commands/create_project.rs +++ /dev/null @@ -1,105 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct CreateProjectArgs { - /// Package name to install - pub package: Option, - - /// Directory to create the project in - pub directory: Option, - - /// Version constraint - pub version: Option, - - /// Minimum stability (stable, RC, beta, alpha, dev) - #[arg(short, long)] - pub stability: Option, - - /// Forces installation from package sources when possible - #[arg(long)] - pub prefer_source: bool, - - /// Forces installation from package dist - #[arg(long)] - pub prefer_dist: bool, - - /// Forces usage of a specific install method (dist, source, auto) - #[arg(long)] - pub prefer_install: Option, - - /// Add a custom repository to discover the package - #[arg(long)] - pub repository: Vec, - - /// [Deprecated] Use --repository instead - #[arg(long)] - pub repository_url: Option, - - /// Add the repository to the composer.json - #[arg(long)] - pub add_repository: bool, - - /// Install require-dev packages - #[arg(long)] - pub dev: bool, - - /// Disables installation of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// [Deprecated] Use --no-plugins instead - #[arg(long)] - pub no_custom_installers: bool, - - /// Skips execution of scripts defined in composer.json - #[arg(long)] - pub no_scripts: bool, - - /// Do not output download progress - #[arg(long)] - pub no_progress: bool, - - /// Disable HTTPS and allow HTTP - #[arg(long)] - pub no_secure_http: bool, - - /// Keep the VCS metadata - #[arg(long)] - pub keep_vcs: bool, - - /// Force removal of the VCS metadata - #[arg(long)] - pub remove_vcs: bool, - - /// Skip the install step after project creation - #[arg(long)] - pub no_install: bool, - - /// Skip the audit step after installation - #[arg(long)] - pub no_audit: bool, - - /// Audit output format - #[arg(long)] - pub audit_format: Option, - - /// Do not block on security advisories - #[arg(long)] - pub no_security_blocking: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, - - /// Interactive package resolution - #[arg(long)] - pub ask: bool, -} - -pub fn execute(_args: &CreateProjectArgs) { - todo!() -} diff --git a/src/commands/depends.rs b/src/commands/depends.rs deleted file mode 100644 index 33aabc6..0000000 --- a/src/commands/depends.rs +++ /dev/null @@ -1,23 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct DependsArgs { - /// Package to inspect - pub package: String, - - /// Recursively resolve up to the root package - #[arg(short, long)] - pub recursive: bool, - - /// Prints the results as a nested tree - #[arg(short, long)] - pub tree: bool, - - /// Read dependency information from the lock file - #[arg(long)] - pub locked: bool, -} - -pub fn execute(_args: &DependsArgs) { - todo!() -} diff --git a/src/commands/diagnose.rs b/src/commands/diagnose.rs deleted file mode 100644 index 5a77ba5..0000000 --- a/src/commands/diagnose.rs +++ /dev/null @@ -1,8 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct DiagnoseArgs {} - -pub fn execute(_args: &DiagnoseArgs) { - todo!() -} diff --git a/src/commands/dump_autoload.rs b/src/commands/dump_autoload.rs deleted file mode 100644 index 0eb20c9..0000000 --- a/src/commands/dump_autoload.rs +++ /dev/null @@ -1,52 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct DumpAutoloadArgs { - /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps - #[arg(short, long)] - pub optimize: bool, - - /// Autoload classes from the classmap only - #[arg(short = 'a', long)] - pub classmap_authoritative: bool, - - /// Use APCu to cache found/not-found classes - #[arg(long)] - pub apcu: bool, - - /// Use a custom prefix for the APCu autoloader cache - #[arg(long)] - pub apcu_prefix: Option, - - /// Only output what would be changed, do not modify files - #[arg(long)] - pub dry_run: bool, - - /// Enables autoload-dev rules - #[arg(long)] - pub dev: bool, - - /// Disables autoload-dev rules - #[arg(long)] - pub no_dev: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, - - /// Return a failed status code if there are PSR mapping errors - #[arg(long)] - pub strict_psr: bool, - - /// Return a failed status code if there are ambiguous class mappings - #[arg(long)] - pub strict_ambiguous: bool, -} - -pub fn execute(_args: &DumpAutoloadArgs) { - todo!() -} diff --git a/src/commands/exec.rs b/src/commands/exec.rs deleted file mode 100644 index 7635058..0000000 --- a/src/commands/exec.rs +++ /dev/null @@ -1,19 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ExecArgs { - /// The binary to run - pub binary: Option, - - /// Arguments to pass to the binary - #[arg(trailing_var_arg = true)] - pub args: Vec, - - /// List the available binaries - #[arg(short, long)] - pub list: bool, -} - -pub fn execute(_args: &ExecArgs) { - todo!() -} diff --git a/src/commands/fund.rs b/src/commands/fund.rs deleted file mode 100644 index bd82306..0000000 --- a/src/commands/fund.rs +++ /dev/null @@ -1,12 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct FundArgs { - /// Output format (text, json) - #[arg(short, long)] - pub format: Option, -} - -pub fn execute(_args: &FundArgs) { - todo!() -} diff --git a/src/commands/global.rs b/src/commands/global.rs deleted file mode 100644 index c4de5e4..0000000 --- a/src/commands/global.rs +++ /dev/null @@ -1,15 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct GlobalArgs { - /// The command name to run - pub command_name: String, - - /// Arguments to pass to the command - #[arg(trailing_var_arg = true)] - pub args: Vec, -} - -pub fn execute(_args: &GlobalArgs) { - todo!() -} diff --git a/src/commands/init.rs b/src/commands/init.rs deleted file mode 100644 index 059e494..0000000 --- a/src/commands/init.rs +++ /dev/null @@ -1,52 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct InitArgs { - /// Name of the package (vendor/name) - #[arg(long)] - pub name: Option, - - /// Description of the package - #[arg(long)] - pub description: Option, - - /// Author name of the package - #[arg(long)] - pub author: Option, - - /// Type of the package - #[arg(long, value_name = "TYPE")] - pub r#type: Option, - - /// Homepage of the package - #[arg(long)] - pub homepage: Option, - - /// Package(s) to require - #[arg(long)] - pub require: Vec, - - /// Package(s) to require for development - #[arg(long)] - pub require_dev: Vec, - - /// Minimum stability (stable, RC, beta, alpha, dev) - #[arg(short, long)] - pub stability: Option, - - /// License of the package - #[arg(short, long)] - pub license: Option, - - /// Add a custom repository - #[arg(long)] - pub repository: Vec, - - /// Define a PSR-4 autoload namespace - #[arg(short, long)] - pub autoload: Option, -} - -pub fn execute(_args: &InitArgs) { - todo!() -} diff --git a/src/commands/install.rs b/src/commands/install.rs deleted file mode 100644 index e839e96..0000000 --- a/src/commands/install.rs +++ /dev/null @@ -1,91 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct InstallArgs { - /// Package(s) to install - pub packages: Vec, - - /// Forces installation from package sources when possible - #[arg(long)] - pub prefer_source: bool, - - /// Forces installation from package dist - #[arg(long)] - pub prefer_dist: bool, - - /// Forces usage of a specific install method (dist, source, auto) - #[arg(long)] - pub prefer_install: Option, - - /// Only output what would be changed, do not modify files - #[arg(long)] - pub dry_run: bool, - - /// Only download packages, do not install - #[arg(long)] - pub download_only: bool, - - /// [Deprecated] Enables installation of require-dev packages - #[arg(long)] - pub dev: bool, - - /// Disables installation of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// Do not block on security advisories - #[arg(long)] - pub no_security_blocking: bool, - - /// Skips autoloader generation - #[arg(long)] - pub no_autoloader: bool, - - /// Do not output download progress - #[arg(long)] - pub no_progress: bool, - - /// Skip the install step - #[arg(long)] - pub no_install: bool, - - /// [Deprecated] Do not show install suggestions - #[arg(long)] - pub no_suggest: bool, - - /// Run audit after installation - #[arg(long)] - pub audit: bool, - - /// Audit output format - #[arg(long)] - pub audit_format: Option, - - /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps - #[arg(short, long)] - pub optimize_autoloader: bool, - - /// Autoload classes from the classmap only - #[arg(short = 'a', long)] - pub classmap_authoritative: bool, - - /// Use APCu to cache found/not-found classes - #[arg(long)] - pub apcu_autoloader: bool, - - /// Use a custom prefix for the APCu autoloader cache - #[arg(long)] - pub apcu_autoloader_prefix: Option, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, -} - -pub fn execute(_args: &InstallArgs) { - todo!() -} diff --git a/src/commands/licenses.rs b/src/commands/licenses.rs deleted file mode 100644 index d9b0caf..0000000 --- a/src/commands/licenses.rs +++ /dev/null @@ -1,20 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct LicensesArgs { - /// Output format (text, json, summary) - #[arg(short, long)] - pub format: Option, - - /// Disables listing of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// List packages from the lock file - #[arg(long)] - pub locked: bool, -} - -pub fn execute(_args: &LicensesArgs) { - todo!() -} diff --git a/src/commands/outdated.rs b/src/commands/outdated.rs deleted file mode 100644 index 3bbb451..0000000 --- a/src/commands/outdated.rs +++ /dev/null @@ -1,67 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct OutdatedArgs { - /// Package to inspect - pub package: Option, - - /// Show only packages that are outdated - #[arg(short, long)] - pub outdated: bool, - - /// Show all installed packages - #[arg(short, long)] - pub all: bool, - - /// Show packages from the lock file - #[arg(long)] - pub locked: bool, - - /// Shows only packages that are directly required by the root package - #[arg(short = 'D', long)] - pub direct: bool, - - /// Return a non-zero exit code when there are outdated packages - #[arg(long)] - pub strict: bool, - - /// Only show packages that have major SemVer-compatible updates - #[arg(short = 'M', long)] - pub major_only: bool, - - /// Only show packages that have minor SemVer-compatible updates - #[arg(short = 'm', long)] - pub minor_only: bool, - - /// Only show packages that have patch SemVer-compatible updates - #[arg(short = 'p', long)] - pub patch_only: bool, - - /// Sort packages by age of the last update - #[arg(short = 'A', long)] - pub sort_by_age: bool, - - /// Output format (text, json) - #[arg(short, long)] - pub format: Option, - - /// Ignore specified package(s) - #[arg(long)] - pub ignore: Vec, - - /// Disables listing of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, -} - -pub fn execute(_args: &OutdatedArgs) { - todo!() -} diff --git a/src/commands/prohibits.rs b/src/commands/prohibits.rs deleted file mode 100644 index aff1ee0..0000000 --- a/src/commands/prohibits.rs +++ /dev/null @@ -1,26 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ProhibitsArgs { - /// Package to inspect - pub package: String, - - /// Version constraint - pub version: String, - - /// Recursively resolve up to the root package - #[arg(short, long)] - pub recursive: bool, - - /// Prints the results as a nested tree - #[arg(short, long)] - pub tree: bool, - - /// Read dependency information from the lock file - #[arg(long)] - pub locked: bool, -} - -pub fn execute(_args: &ProhibitsArgs) { - todo!() -} diff --git a/src/commands/reinstall.rs b/src/commands/reinstall.rs deleted file mode 100644 index 08aad44..0000000 --- a/src/commands/reinstall.rs +++ /dev/null @@ -1,59 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ReinstallArgs { - /// Package(s) to reinstall - pub packages: Vec, - - /// Forces installation from package sources when possible - #[arg(long)] - pub prefer_source: bool, - - /// Forces installation from package dist - #[arg(long)] - pub prefer_dist: bool, - - /// Forces usage of a specific install method (dist, source, auto) - #[arg(long)] - pub prefer_install: Option, - - /// Skips autoloader generation - #[arg(long)] - pub no_autoloader: bool, - - /// Do not output download progress - #[arg(long)] - pub no_progress: bool, - - /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps - #[arg(short, long)] - pub optimize_autoloader: bool, - - /// Autoload classes from the classmap only - #[arg(short = 'a', long)] - pub classmap_authoritative: bool, - - /// Use APCu to cache found/not-found classes - #[arg(long)] - pub apcu_autoloader: bool, - - /// Use a custom prefix for the APCu autoloader cache - #[arg(long)] - pub apcu_autoloader_prefix: Option, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, - - /// Filter packages to reinstall by type - #[arg(long, value_name = "TYPE")] - pub r#type: Vec, -} - -pub fn execute(_args: &ReinstallArgs) { - todo!() -} diff --git a/src/commands/remove.rs b/src/commands/remove.rs deleted file mode 100644 index b444a66..0000000 --- a/src/commands/remove.rs +++ /dev/null @@ -1,95 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct RemoveArgs { - /// Package(s) to remove - pub packages: Vec, - - /// Remove from require-dev - #[arg(long)] - pub dev: bool, - - /// Only output what would be changed, do not modify files - #[arg(long)] - pub dry_run: bool, - - /// Do not output download progress - #[arg(long)] - pub no_progress: bool, - - /// Disables the automatic update of the lock file - #[arg(long)] - pub no_update: bool, - - /// Skip the install step - #[arg(long)] - pub no_install: bool, - - /// Skip the audit step - #[arg(long)] - pub no_audit: bool, - - /// Audit output format - #[arg(long)] - pub audit_format: Option, - - /// Do not block on security advisories - #[arg(long)] - pub no_security_blocking: bool, - - /// Run the dependency update with the --no-dev option - #[arg(long)] - pub update_no_dev: bool, - - /// [Deprecated] Use --with-all-dependencies instead - #[arg(short = 'w', long)] - pub update_with_dependencies: bool, - - /// [Deprecated] Use --with-all-dependencies instead - #[arg(short = 'W', long)] - pub update_with_all_dependencies: bool, - - /// Update also dependencies of the removed packages - #[arg(long)] - pub with_all_dependencies: bool, - - /// Skip updating dependencies - #[arg(long)] - pub no_update_with_dependencies: bool, - - /// Prefer minimal restriction updates - #[arg(short = 'm', long)] - pub minimal_changes: bool, - - /// Remove unused packages - #[arg(long)] - pub unused: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, - - /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps - #[arg(short, long)] - pub optimize_autoloader: bool, - - /// Autoload classes from the classmap only - #[arg(short = 'a', long)] - pub classmap_authoritative: bool, - - /// Use APCu to cache found/not-found classes - #[arg(long)] - pub apcu_autoloader: bool, - - /// Use a custom prefix for the APCu autoloader cache - #[arg(long)] - pub apcu_autoloader_prefix: Option, -} - -pub fn execute(_args: &RemoveArgs) { - todo!() -} diff --git a/src/commands/repository.rs b/src/commands/repository.rs deleted file mode 100644 index 8646c06..0000000 --- a/src/commands/repository.rs +++ /dev/null @@ -1,40 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct RepositoryArgs { - /// Action (list, add, remove, set-url, get-url, enable, disable) - pub action: Option, - - /// Repository name - pub name: Option, - - /// Argument 1 (URL or type depending on action) - pub arg1: Option, - - /// Argument 2 - pub arg2: Option, - - /// Apply to the global config file - #[arg(short, long)] - pub global: bool, - - /// Use a specific config file - #[arg(short, long)] - pub file: Option, - - /// Append the repository instead of prepending it - #[arg(long)] - pub append: bool, - - /// Add before a specific repository - #[arg(long)] - pub before: Option, - - /// Add after a specific repository - #[arg(long)] - pub after: Option, -} - -pub fn execute(_args: &RepositoryArgs) { - todo!() -} diff --git a/src/commands/require.rs b/src/commands/require.rs deleted file mode 100644 index 3b8cceb..0000000 --- a/src/commands/require.rs +++ /dev/null @@ -1,123 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct RequireArgs { - /// Package(s) to require - pub packages: Vec, - - /// Add requirement to require-dev - #[arg(long)] - pub dev: bool, - - /// Only output what would be changed, do not modify files - #[arg(long)] - pub dry_run: bool, - - /// Forces installation from package sources when possible - #[arg(long)] - pub prefer_source: bool, - - /// Forces installation from package dist - #[arg(long)] - pub prefer_dist: bool, - - /// Forces usage of a specific install method (dist, source, auto) - #[arg(long)] - pub prefer_install: Option, - - /// Pin the exact version instead of a range - #[arg(long)] - pub fixed: bool, - - /// [Deprecated] Do not show install suggestions - #[arg(long)] - pub no_suggest: bool, - - /// Do not output download progress - #[arg(long)] - pub no_progress: bool, - - /// Disables the automatic update of the lock file - #[arg(long)] - pub no_update: bool, - - /// Skip the install step - #[arg(long)] - pub no_install: bool, - - /// Skip the audit step - #[arg(long)] - pub no_audit: bool, - - /// Audit output format - #[arg(long)] - pub audit_format: Option, - - /// Do not block on security advisories - #[arg(long)] - pub no_security_blocking: bool, - - /// Run the dependency update with the --no-dev option - #[arg(long)] - pub update_no_dev: bool, - - /// [Deprecated] Use --with-dependencies instead - #[arg(short = 'w', long)] - pub update_with_dependencies: bool, - - /// [Deprecated] Use --with-all-dependencies instead - #[arg(short = 'W', long)] - pub update_with_all_dependencies: bool, - - /// Update also dependencies of newly required packages - #[arg(long)] - pub with_dependencies: bool, - - /// Update all dependencies including root requirements - #[arg(long)] - pub with_all_dependencies: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, - - /// Prefer stable versions of dependencies - #[arg(long)] - pub prefer_stable: bool, - - /// Prefer lowest versions of dependencies - #[arg(long)] - pub prefer_lowest: bool, - - /// Prefer minimal restriction updates - #[arg(short = 'm', long)] - pub minimal_changes: bool, - - /// Sort packages in composer.json - #[arg(long)] - pub sort_packages: bool, - - /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps - #[arg(short, long)] - pub optimize_autoloader: bool, - - /// Autoload classes from the classmap only - #[arg(short = 'a', long)] - pub classmap_authoritative: bool, - - /// Use APCu to cache found/not-found classes - #[arg(long)] - pub apcu_autoloader: bool, - - /// Use a custom prefix for the APCu autoloader cache - #[arg(long)] - pub apcu_autoloader_prefix: Option, -} - -pub fn execute(_args: &RequireArgs) { - todo!() -} diff --git a/src/commands/run_script.rs b/src/commands/run_script.rs deleted file mode 100644 index e2349a2..0000000 --- a/src/commands/run_script.rs +++ /dev/null @@ -1,31 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct RunScriptArgs { - /// Script name to run - pub script: Option, - - /// Arguments to pass to the script - #[arg(trailing_var_arg = true)] - pub args: Vec, - - /// Set the script timeout in seconds - #[arg(long)] - pub timeout: Option, - - /// Sets the dev mode - #[arg(long)] - pub dev: bool, - - /// Disables the dev mode - #[arg(long)] - pub no_dev: bool, - - /// List the available scripts - #[arg(short, long)] - pub list: bool, -} - -pub fn execute(_args: &RunScriptArgs) { - todo!() -} diff --git a/src/commands/search.rs b/src/commands/search.rs deleted file mode 100644 index 3d2d20f..0000000 --- a/src/commands/search.rs +++ /dev/null @@ -1,28 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct SearchArgs { - /// Search tokens - #[arg(required = true)] - pub tokens: Vec, - - /// Search only in name - #[arg(short = 'N', long)] - pub only_name: bool, - - /// Search only for vendor / organization - #[arg(short = 'O', long)] - pub only_vendor: bool, - - /// Filter by package type - #[arg(short, long, value_name = "TYPE")] - pub r#type: Option, - - /// Output format (text, json) - #[arg(short, long)] - pub format: Option, -} - -pub fn execute(_args: &SearchArgs) { - todo!() -} diff --git a/src/commands/self_update.rs b/src/commands/self_update.rs deleted file mode 100644 index 3497d7d..0000000 --- a/src/commands/self_update.rs +++ /dev/null @@ -1,55 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct SelfUpdateArgs { - /// Version to update to - pub version: Option, - - /// Revert to a previous version - #[arg(short, long)] - pub rollback: bool, - - /// Delete old backups during self-update - #[arg(long)] - pub clean_backups: bool, - - /// Do not output download progress - #[arg(long)] - pub no_progress: bool, - - /// Prompt user for a key update - #[arg(long)] - pub update_keys: bool, - - /// Force update to the stable channel - #[arg(long)] - pub stable: bool, - - /// Force update to the preview channel - #[arg(long)] - pub preview: bool, - - /// Force update to the snapshot channel - #[arg(long)] - pub snapshot: bool, - - /// Force update to the 1.x channel - #[arg(long = "1")] - pub channel_1: bool, - - /// Force update to the 2.x channel - #[arg(long = "2")] - pub channel_2: bool, - - /// Force update to the 2.2.x LTS channel - #[arg(long = "2.2")] - pub channel_2_2: bool, - - /// Only store the channel as default and skip the update - #[arg(long)] - pub set_channel_only: bool, -} - -pub fn execute(_args: &SelfUpdateArgs) { - todo!() -} diff --git a/src/commands/show.rs b/src/commands/show.rs deleted file mode 100644 index 290a8dd..0000000 --- a/src/commands/show.rs +++ /dev/null @@ -1,102 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ShowArgs { - /// Package to inspect - pub package: Option, - - /// Version constraint - pub version: Option, - - /// List all packages - #[arg(long)] - pub all: bool, - - /// List packages from the lock file - #[arg(long)] - pub locked: bool, - - /// Show only installed packages (enabled by default) - #[arg(short, long)] - pub installed: bool, - - /// List platform packages only - #[arg(short, long)] - pub platform: bool, - - /// List available packages only - #[arg(short = 'a', long)] - pub available: bool, - - /// Show information about the root package - #[arg(short, long, name = "self")] - pub self_info: bool, - - /// Show package names only - #[arg(short = 'N', long)] - pub name_only: bool, - - /// Show package paths only - #[arg(short = 'P', long)] - pub path: bool, - - /// List the dependencies as a tree - #[arg(short, long)] - pub tree: bool, - - /// Show the latest version - #[arg(short, long)] - pub latest: bool, - - /// Show only packages that are outdated - #[arg(short, long)] - pub outdated: bool, - - /// Ignore specified package(s) - #[arg(long)] - pub ignore: Vec, - - /// Only show packages that have major SemVer-compatible updates - #[arg(short = 'M', long)] - pub major_only: bool, - - /// Only show packages that have minor SemVer-compatible updates - #[arg(short = 'm', long)] - pub minor_only: bool, - - /// Only show packages that have patch SemVer-compatible updates - #[arg(long)] - pub patch_only: bool, - - /// Sort packages by age of the last update - #[arg(short = 'A', long)] - pub sort_by_age: bool, - - /// Shows only packages that are directly required by the root package - #[arg(short = 'D', long)] - pub direct: bool, - - /// Return a non-zero exit code when there are outdated packages - #[arg(long)] - pub strict: bool, - - /// Output format (text, json) - #[arg(short, long)] - pub format: Option, - - /// Disables listing of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, -} - -pub fn execute(_args: &ShowArgs) { - todo!() -} diff --git a/src/commands/status.rs b/src/commands/status.rs deleted file mode 100644 index 424f404..0000000 --- a/src/commands/status.rs +++ /dev/null @@ -1,8 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct StatusArgs {} - -pub fn execute(_args: &StatusArgs) { - todo!() -} diff --git a/src/commands/suggests.rs b/src/commands/suggests.rs deleted file mode 100644 index 6a80501..0000000 --- a/src/commands/suggests.rs +++ /dev/null @@ -1,31 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct SuggestsArgs { - /// Package(s) to list suggestions for - pub packages: Vec, - - /// Group output by package - #[arg(long)] - pub by_package: bool, - - /// Group output by suggestion - #[arg(long)] - pub by_suggestion: bool, - - /// Show suggestions for all packages, not just root - #[arg(short, long)] - pub all: bool, - - /// Show only suggested package names in list format - #[arg(long)] - pub list: bool, - - /// Disables suggestions from require-dev packages - #[arg(long)] - pub no_dev: bool, -} - -pub fn execute(_args: &SuggestsArgs) { - todo!() -} diff --git a/src/commands/update.rs b/src/commands/update.rs deleted file mode 100644 index 0f1257c..0000000 --- a/src/commands/update.rs +++ /dev/null @@ -1,131 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct UpdateArgs { - /// Package(s) to update - pub packages: Vec, - - /// Temporary version constraint overrides - #[arg(long)] - pub with: Vec, - - /// Forces installation from package sources when possible - #[arg(long)] - pub prefer_source: bool, - - /// Forces installation from package dist - #[arg(long)] - pub prefer_dist: bool, - - /// Forces usage of a specific install method (dist, source, auto) - #[arg(long)] - pub prefer_install: Option, - - /// Only output what would be changed, do not modify files - #[arg(long)] - pub dry_run: bool, - - /// [Deprecated] Enables installation of require-dev packages - #[arg(long)] - pub dev: bool, - - /// Disables installation of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// Only updates the lock file hash - #[arg(long)] - pub lock: bool, - - /// Skip the install step - #[arg(long)] - pub no_install: bool, - - /// Skip the audit step - #[arg(long)] - pub no_audit: bool, - - /// Audit output format - #[arg(long)] - pub audit_format: Option, - - /// Do not block on security advisories - #[arg(long)] - pub no_security_blocking: bool, - - /// Skips autoloader generation - #[arg(long)] - pub no_autoloader: bool, - - /// [Deprecated] Do not show install suggestions - #[arg(long)] - pub no_suggest: bool, - - /// Do not output download progress - #[arg(long)] - pub no_progress: bool, - - /// Update also dependencies of packages in the argument list - #[arg(short = 'w', long)] - pub with_dependencies: bool, - - /// Update also all dependencies including root requirements - #[arg(short = 'W', long)] - pub with_all_dependencies: bool, - - /// Optimizes PSR-0 and PSR-4 packages to be loaded with classmaps - #[arg(short, long)] - pub optimize_autoloader: bool, - - /// Autoload classes from the classmap only - #[arg(short = 'a', long)] - pub classmap_authoritative: bool, - - /// Use APCu to cache found/not-found classes - #[arg(long)] - pub apcu_autoloader: bool, - - /// Use a custom prefix for the APCu autoloader cache - #[arg(long)] - pub apcu_autoloader_prefix: Option, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec, - - /// Ignore all platform requirements - #[arg(long)] - pub ignore_platform_reqs: bool, - - /// Prefer stable versions of dependencies - #[arg(long)] - pub prefer_stable: bool, - - /// Prefer lowest versions of dependencies - #[arg(long)] - pub prefer_lowest: bool, - - /// Prefer minimal restriction updates - #[arg(short = 'm', long)] - pub minimal_changes: bool, - - /// Only allow patch version updates - #[arg(long)] - pub patch_only: bool, - - /// Interactive package selection - #[arg(short, long)] - pub interactive: bool, - - /// Only update packages that are root requirements - #[arg(long)] - pub root_reqs: bool, - - /// Bump version constraints after update (dev, no-dev, all) - #[arg(long)] - pub bump_after_update: Option>, -} - -pub fn execute(_args: &UpdateArgs) { - todo!() -} diff --git a/src/commands/validate.rs b/src/commands/validate.rs deleted file mode 100644 index b76d479..0000000 --- a/src/commands/validate.rs +++ /dev/null @@ -1,39 +0,0 @@ -use clap::Args; - -#[derive(Args)] -pub struct ValidateArgs { - /// Path to composer.json file - pub file: Option, - - /// Skips checks for non-essential issues - #[arg(long)] - pub no_check_all: bool, - - /// Validates the lock file - #[arg(long)] - pub check_lock: bool, - - /// Skips lock file validation - #[arg(long)] - pub no_check_lock: bool, - - /// Skips publish-related checks - #[arg(long)] - pub no_check_publish: bool, - - /// Skips version constraint checks - #[arg(long)] - pub no_check_version: bool, - - /// Also validate all dependencies - #[arg(short = 'A', long)] - pub with_dependencies: bool, - - /// Return a non-zero exit code on warnings as well as errors - #[arg(long)] - pub strict: bool, -} - -pub fn execute(_args: &ValidateArgs) { - todo!() -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 82b6da3..0000000 --- a/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod commands; diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 289d047..0000000 --- a/src/main.rs +++ /dev/null @@ -1,7 +0,0 @@ -use clap::Parser; -use mozart::commands; - -fn main() { - let cli = commands::Cli::parse(); - commands::execute(&cli.command); -} -- cgit v1.3.1