aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mozart/src/commands')
-rw-r--r--crates/mozart/src/commands/about.rs8
-rw-r--r--crates/mozart/src/commands/archive.rs30
-rw-r--r--crates/mozart/src/commands/audit.rs32
-rw-r--r--crates/mozart/src/commands/browse.rs19
-rw-r--r--crates/mozart/src/commands/bump.rs23
-rw-r--r--crates/mozart/src/commands/check_platform_reqs.rs20
-rw-r--r--crates/mozart/src/commands/clear_cache.rs12
-rw-r--r--crates/mozart/src/commands/config.rs58
-rw-r--r--crates/mozart/src/commands/create_project.rs105
-rw-r--r--crates/mozart/src/commands/depends.rs23
-rw-r--r--crates/mozart/src/commands/diagnose.rs8
-rw-r--r--crates/mozart/src/commands/dump_autoload.rs52
-rw-r--r--crates/mozart/src/commands/exec.rs19
-rw-r--r--crates/mozart/src/commands/fund.rs12
-rw-r--r--crates/mozart/src/commands/global.rs15
-rw-r--r--crates/mozart/src/commands/init.rs52
-rw-r--r--crates/mozart/src/commands/install.rs91
-rw-r--r--crates/mozart/src/commands/licenses.rs20
-rw-r--r--crates/mozart/src/commands/outdated.rs67
-rw-r--r--crates/mozart/src/commands/prohibits.rs26
-rw-r--r--crates/mozart/src/commands/reinstall.rs59
-rw-r--r--crates/mozart/src/commands/remove.rs95
-rw-r--r--crates/mozart/src/commands/repository.rs40
-rw-r--r--crates/mozart/src/commands/require.rs123
-rw-r--r--crates/mozart/src/commands/run_script.rs31
-rw-r--r--crates/mozart/src/commands/search.rs28
-rw-r--r--crates/mozart/src/commands/self_update.rs55
-rw-r--r--crates/mozart/src/commands/show.rs102
-rw-r--r--crates/mozart/src/commands/status.rs8
-rw-r--r--crates/mozart/src/commands/suggests.rs31
-rw-r--r--crates/mozart/src/commands/update.rs131
-rw-r--r--crates/mozart/src/commands/validate.rs39
32 files changed, 1434 insertions, 0 deletions
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<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/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<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/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<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/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<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/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<String>,
+}
+
+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<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/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<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/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<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/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<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/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<String>,
+}
+
+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<String>,
+}
+
+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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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/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<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!()
+}