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

cargo -C should have a long name #11696

Open
epage opened this issue Feb 10, 2023 · 4 comments
Open

cargo -C should have a long name #11696

epage opened this issue Feb 10, 2023 · 4 comments
Labels
A-cli Area: Command-line interface, option parsing, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` P-low Priority: Low S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@epage
Copy link
Contributor

epage commented Feb 10, 2023

Problem

#10952 added -C to solve #10098 and reduce #2930's impact but we couldn't get buy-in on a name and shipped it as-is to not block the feature on the long name as -C by itself has enough use within the community

Proposed Solution

From ehuss:

I don't have a strong opinion about the long name. --cwd or --cd seems more explicit as to what it does, and would lean slightly towards that, but other options seem fine. -C seems to be the most common for a short flag.

A quick survey:

  • make: -C or --directory
  • git: -C
  • Meson: -C
  • ninja: -C
  • hg: --cwd
  • Gradle: -p, --project-dir?
  • Julia: --project?
  • Swift: -working-directory?
  • dub: --root
  • msbuild: passed as first argument
  • npm: n/a
  • Ivy: n/a?
  • Maven: n/a?
  • Bazel: n/a?
  • Buck: n/a?
  • go: -C
  • nuget: n/a?
  • sbt: n/a?
  • dart: -C or --directory

Other command line tools with similar flags:

  • tar: -C or --directory (BSD tar has --cd)
  • ls: -d or --directory to list directories
    • rm: -d or --dir to remove directories

Plus the stdlib calls this "current dir" (std::env::current_dir, std::process::Command::current_dir) so we could name it --current-dir

Notes

No response

@epage epage added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` A-cli Area: Command-line interface, option parsing, etc. labels Feb 10, 2023
@epage
Copy link
Contributor Author

epage commented Feb 10, 2023

Non-blocker for this: we could make it so all commonly used long names that are too CWD-specific or too generic to be used for anything else (e.g. --directory) are hidden aliases for -C, maybe with a message directing users to -C

@supreetsingh10
Copy link

Good evening, this issue is open, I wonder if anyone is taking this up? I think I can solve this issue. If this is available I can work on this?

@weihanglo weihanglo added S-needs-team-input Status: Needs input from team on whether/how to proceed. P-low Priority: Low labels May 7, 2023
@weihanglo
Copy link
Member

Hi, @supreetsingh10. Thanks for being interested in helping this project.

The fix for this should be relatively straightforward. However, it currently needs some inputs from the Cargo team to proceed. As it is not really in a high priority, and it is more a bikeshedding problem, we haven't put too many efforts on deciding the name.

In the meantime, if you are willing to contribute to Cargo in general, I'd suggest looking into issue with label S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review . We are happy to guide through and review those. Thank you!

See also how our issue tracker works.

@supreetsingh10
Copy link

Thank you very much, I would do that. I am also on the Zulip group and I will be in touch. Thank you :)

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. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` P-low Priority: Low S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

3 participants