created a function for user defined aliases#15076
Merged
epage merged 1 commit intorust-lang:masterfrom Jan 17, 2025
ibilalkayy:user_defined_alises
Merged
created a function for user defined aliases#15076epage merged 1 commit intorust-lang:masterfrom ibilalkayy:user_defined_alises
epage merged 1 commit intorust-lang:masterfrom
ibilalkayy:user_defined_alises
Conversation
Collaborator
epage
reviewed
Jan 17, 2025
src/bin/cargo/main.rs
Outdated
| commands | ||
| } | ||
|
|
||
| fn user_defined_aliases(gctx: &GlobalContext, commands: &mut BTreeMap<String, CommandInfo>) { |
Contributor
There was a problem hiding this comment.
let's be consistent in how we define these functions rather than one using a return value and another an out param
removed the command parameter and returned it in order to extend the command with an alias
Contributor
Author
|
@epage I removed the command parameter this time and returned it to call it in the |
epage
approved these changes
Jan 17, 2025
Contributor
Author
|
Thank you, @epage for your guidance and approval! |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 18, 2025
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)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 18, 2025
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!