diff options
Diffstat (limited to 'src')
35 files changed, 0 insertions, 1672 deletions
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<String>, - - /// 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<String>, - - /// A version constraint - pub version: Option<String>, - - /// Format of the resulting archive (tar, tar.gz, tar.bz2, zip) - #[arg(short, long)] - pub format: Option<String>, - - /// Write the archive to this directory - #[arg(long)] - pub dir: Option<String>, - - /// Write the archive with the given file name - #[arg(long)] - pub file: Option<String>, - - /// 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<String>, - - /// Ignore advisories of a given severity (low, medium, high, critical) - #[arg(long)] - pub ignore_severity: Vec<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, -} - -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<String>, - - /// Setting value(s) - pub setting_value: Vec<String>, - - /// 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<String>, - - /// 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<String>, - - /// Directory to create the project in - pub directory: Option<String>, - - /// Version constraint - pub version: Option<String>, - - /// Minimum stability (stable, RC, beta, alpha, dev) - #[arg(short, long)] - pub stability: Option<String>, - - /// 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<String>, - - /// Add a custom repository to discover the package - #[arg(long)] - pub repository: Vec<String>, - - /// [Deprecated] Use --repository instead - #[arg(long)] - pub repository_url: Option<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// Arguments to pass to the binary - #[arg(trailing_var_arg = true)] - pub args: Vec<String>, - - /// 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<String>, -} - -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<String>, -} - -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<String>, - - /// Description of the package - #[arg(long)] - pub description: Option<String>, - - /// Author name of the package - #[arg(long)] - pub author: Option<String>, - - /// Type of the package - #[arg(long, value_name = "TYPE")] - pub r#type: Option<String>, - - /// Homepage of the package - #[arg(long)] - pub homepage: Option<String>, - - /// Package(s) to require - #[arg(long)] - pub require: Vec<String>, - - /// Package(s) to require for development - #[arg(long)] - pub require_dev: Vec<String>, - - /// Minimum stability (stable, RC, beta, alpha, dev) - #[arg(short, long)] - pub stability: Option<String>, - - /// License of the package - #[arg(short, long)] - pub license: Option<String>, - - /// Add a custom repository - #[arg(long)] - pub repository: Vec<String>, - - /// Define a PSR-4 autoload namespace - #[arg(short, long)] - pub autoload: Option<String>, -} - -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<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// Ignore specified package(s) - #[arg(long)] - pub ignore: Vec<String>, - - /// Disables listing of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec<String>, - - /// 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<String>, -} - -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<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, -} - -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<String>, - - /// Repository name - pub name: Option<String>, - - /// Argument 1 (URL or type depending on action) - pub arg1: Option<String>, - - /// Argument 2 - pub arg2: Option<String>, - - /// Apply to the global config file - #[arg(short, long)] - pub global: bool, - - /// Use a specific config file - #[arg(short, long)] - pub file: Option<String>, - - /// Append the repository instead of prepending it - #[arg(long)] - pub append: bool, - - /// Add before a specific repository - #[arg(long)] - pub before: Option<String>, - - /// Add after a specific repository - #[arg(long)] - pub after: Option<String>, -} - -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<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, -} - -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<String>, - - /// Arguments to pass to the script - #[arg(trailing_var_arg = true)] - pub args: Vec<String>, - - /// Set the script timeout in seconds - #[arg(long)] - pub timeout: Option<u64>, - - /// 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<String>, - - /// 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<String>, - - /// Output format (text, json) - #[arg(short, long)] - pub format: Option<String>, -} - -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<String>, - - /// 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<String>, - - /// Version constraint - pub version: Option<String>, - - /// 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<String>, - - /// 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<String>, - - /// Disables listing of require-dev packages - #[arg(long)] - pub no_dev: bool, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec<String>, - - /// 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<String>, - - /// 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<String>, - - /// Temporary version constraint overrides - #[arg(long)] - pub with: Vec<String>, - - /// 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<String>, - - /// 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<String>, - - /// 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<String>, - - /// Ignore a specific platform requirement - #[arg(long)] - pub ignore_platform_req: Vec<String>, - - /// 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<Option<String>>, -} - -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<String>, - - /// 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); -} |
