Skip to content
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

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

ibilalkayy
Copy link
Contributor

@ibilalkayy ibilalkayy commented Jan 17, 2025

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!

@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 17, 2025
@@ -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>) {
Copy link
Contributor

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

Copy link

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
@ibilalkayy
Copy link
Contributor Author

ibilalkayy commented Jan 17, 2025

@epage I removed the command parameter this time and returned it to call it in the list_commands function. After calling it, I used .extend

@epage epage added this pull request to the merge queue Jan 17, 2025
Merged via the queue into rust-lang:master with commit 045bf21 Jan 17, 2025
21 checks passed
@ibilalkayy ibilalkayy deleted the user_defined_alises branch January 17, 2025 15:31
@ibilalkayy
Copy link
Contributor Author

ibilalkayy commented Jan 17, 2025

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)
@rustbot rustbot added this to the 1.86.0 milestone Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants