From 2154fc0e841bb56b26f53cee60954568bfe19e67 Mon Sep 17 00:00:00 2001 From: daimond113 Date: Sat, 1 Feb 2025 01:01:40 +0100 Subject: [PATCH] refactor: reorder commands in help message Reorders the commands in the help message so they appear in a more logical order. --- src/cli/commands/mod.rs | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/cli/commands/mod.rs b/src/cli/commands/mod.rs index c9fd1ce..ebadd00 100644 --- a/src/cli/commands/mod.rs +++ b/src/cli/commands/mod.rs @@ -38,18 +38,29 @@ pub enum Subcommand { /// Initializes a manifest file in the current directory Init(init::InitCommand), - /// Runs a script, an executable package, or a file with Lune - Run(run::RunCommand), + /// Adds a dependency to the project + Add(add::AddCommand), /// Installs all dependencies for the project Install(install::InstallCommand), + /// Updates the project's lockfile. Run install to apply changes + Update(update::UpdateCommand), + + /// Checks for outdated dependencies + Outdated(outdated::OutdatedCommand), + + /// Runs a script, an executable package, or a file with Lune + Run(run::RunCommand), + /// Publishes the project to the registry Publish(publish::PublishCommand), - /// Installs the pesde binary and scripts - #[cfg(feature = "version-management")] - SelfInstall(self_install::SelfInstallCommand), + /// Yanks a package from the registry + Yank(yank::YankCommand), + + /// Deprecates a package from the registry + Deprecate(deprecate::DeprecateCommand), /// Sets up a patching environment for a package #[cfg(feature = "patches")] @@ -59,28 +70,17 @@ pub enum Subcommand { #[cfg(feature = "patches")] PatchCommit(patch_commit::PatchCommitCommand), - /// Installs the latest version of pesde - #[cfg(feature = "version-management")] - SelfUpgrade(self_upgrade::SelfUpgradeCommand), - - /// Adds a dependency to the project - Add(add::AddCommand), - - /// Updates the project's lockfile. Run install to apply changes - Update(update::UpdateCommand), - - /// Checks for outdated dependencies - Outdated(outdated::OutdatedCommand), - /// Executes a binary package without needing to be run in a project directory #[clap(name = "x", visible_alias = "execute", visible_alias = "exec")] Execute(execute::ExecuteCommand), - /// Yanks a package from the registry - Yank(yank::YankCommand), + /// Installs the pesde binary and scripts + #[cfg(feature = "version-management")] + SelfInstall(self_install::SelfInstallCommand), - /// Deprecates a package from the registry - Deprecate(deprecate::DeprecateCommand), + /// Installs the latest version of pesde + #[cfg(feature = "version-management")] + SelfUpgrade(self_upgrade::SelfUpgradeCommand), } impl Subcommand { @@ -90,23 +90,23 @@ impl Subcommand { Subcommand::Config(config) => config.run().await, Subcommand::Cas(cas) => cas.run(project).await, Subcommand::Init(init) => init.run(project).await, - Subcommand::Run(run) => run.run(project).await, + Subcommand::Add(add) => add.run(project).await, Subcommand::Install(install) => install.run(project, reqwest).await, + Subcommand::Update(update) => update.run(project, reqwest).await, + Subcommand::Outdated(outdated) => outdated.run(project).await, + Subcommand::Run(run) => run.run(project).await, Subcommand::Publish(publish) => publish.run(project, reqwest).await, - #[cfg(feature = "version-management")] - Subcommand::SelfInstall(self_install) => self_install.run().await, + Subcommand::Yank(yank) => yank.run(project, reqwest).await, + Subcommand::Deprecate(deprecate) => deprecate.run(project, reqwest).await, #[cfg(feature = "patches")] Subcommand::Patch(patch) => patch.run(project, reqwest).await, #[cfg(feature = "patches")] Subcommand::PatchCommit(patch_commit) => patch_commit.run(project).await, + Subcommand::Execute(execute) => execute.run(project, reqwest).await, + #[cfg(feature = "version-management")] + Subcommand::SelfInstall(self_install) => self_install.run().await, #[cfg(feature = "version-management")] Subcommand::SelfUpgrade(self_upgrade) => self_upgrade.run(reqwest).await, - Subcommand::Add(add) => add.run(project).await, - Subcommand::Update(update) => update.run(project, reqwest).await, - Subcommand::Outdated(outdated) => outdated.run(project).await, - Subcommand::Execute(execute) => execute.run(project, reqwest).await, - Subcommand::Yank(yank) => yank.run(project, reqwest).await, - Subcommand::Deprecate(deprecate) => deprecate.run(project, reqwest).await, } } }