-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
created a function for user defined aliases #15076
Conversation
src/bin/cargo/main.rs
Outdated
@@ -258,6 +249,20 @@ fn third_party_subcommands(gctx: &GlobalContext) -> BTreeMap<String, CommandInfo | |||
commands | |||
} | |||
|
|||
fn user_defined_aliases(gctx: &GlobalContext, commands: &mut BTreeMap<String, CommandInfo>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's be consistent in how we define these functions rather than one using a return value and another an out param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
removed the command parameter and returned it in order to extend the command with an alias
d88e48d
to
e01660d
Compare
@epage I removed the command parameter this time and returned it to call it in the |
Thank you, @epage for your guidance and approval! |
Update cargo 13 commits in 088d496082726091024f1689c124a0c3dccbd775..045bf21b36a2e1f3ed85e38278d1c3cc4305e134 2025-01-10 20:10:21 +0000 to 2025-01-17 14:59:36 +0000 - created a function for user defined aliases (rust-lang/cargo#15076) - took the functionality of the third party subcommand from the list_commands function (rust-lang/cargo#15075) - fix: wrong concat and field name (rust-lang/cargo#15074) - fix(publish): Report all unpublishable packages (rust-lang/cargo#15070) - docs(cargo-clippy): correct typo (rust-lang/cargo#15072) - docs(cargo-package): alwasy include the lockfile (rust-lang/cargo#15067) - docs(ref): Deprecate 'package.authors' (rust-lang/cargo#15068) - fix(build-std): parse as comma-separated list (rust-lang/cargo#15065) - Fix benchsuite issue with newer versions of git (rust-lang/cargo#15069) - Document that cargo automatically registers variables used in env! macro to trigger rebuilds (rust-lang/cargo#15062) - perf(cargo-package): match certain path prefix with pathspec (rust-lang/cargo#14997) - Clarify note in example (rust-lang/cargo#15054) - chore(deps): update msrv (3 versions) to v1.82 (rust-lang/cargo#15050)
Update cargo 13 commits in 088d496082726091024f1689c124a0c3dccbd775..045bf21b36a2e1f3ed85e38278d1c3cc4305e134 2025-01-10 20:10:21 +0000 to 2025-01-17 14:59:36 +0000 - created a function for user defined aliases (rust-lang/cargo#15076) - took the functionality of the third party subcommand from the list_commands function (rust-lang/cargo#15075) - fix: wrong concat and field name (rust-lang/cargo#15074) - fix(publish): Report all unpublishable packages (rust-lang/cargo#15070) - docs(cargo-clippy): correct typo (rust-lang/cargo#15072) - docs(cargo-package): alwasy include the lockfile (rust-lang/cargo#15067) - docs(ref): Deprecate 'package.authors' (rust-lang/cargo#15068) - fix(build-std): parse as comma-separated list (rust-lang/cargo#15065) - Fix benchsuite issue with newer versions of git (rust-lang/cargo#15069) - Document that cargo automatically registers variables used in env! macro to trigger rebuilds (rust-lang/cargo#15062) - perf(cargo-package): match certain path prefix with pathspec (rust-lang/cargo#14997) - Clarify note in example (rust-lang/cargo#15054) - chore(deps): update msrv (3 versions) to v1.82 (rust-lang/cargo#15050)
Hey there,
As mentioned in this issue, I worked on the functionality of autocompleting the user-defined aliases and I moved the code of user-defined aliases into a separate function by defining two parameters. The first one is global context or gctx and the second one is the commands that can be called in the list_commands function.
Thank you!