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

feat(cli): Add --env-file as alternative to --env #24555

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

birkskyum
Copy link
Contributor

@birkskyum birkskyum commented Jul 12, 2024

Closes #24528, see comment here on Deno 2

This pr rename --env to --env-file for several reasons (see issue), but allow --env to keep working as an alias.

I've added 2 unit tests to make sure both --env and --env-file work

@birkskyum birkskyum changed the title fix(node-compat): Rename --env to --env-file fix(cli): Rename --env to --env-file Jul 12, 2024
@birkskyum birkskyum changed the title fix(cli): Rename --env to --env-file BREAKING(cli): Rename --env to --env-file Jul 12, 2024
@bartlomieju bartlomieju added this to the 1.46 milestone Jul 18, 2024
@birkskyum birkskyum changed the title BREAKING(cli): Rename --env to --env-file feat(cli): Add --env-file as a long alias to --env Aug 2, 2024
@birkskyum birkskyum force-pushed the env-file branch 2 times, most recently from 0c5fb96 to acaa9d9 Compare August 2, 2024 16:53
@birkskyum birkskyum changed the title feat(cli): Add --env-file as a long alias to --env feat(cli): Add --env-file as alternative to --env Aug 2, 2024
@birkskyum birkskyum force-pushed the env-file branch 3 times, most recently from cdd6238 to 3beb8a7 Compare August 5, 2024 13:05
@birkskyum
Copy link
Contributor Author

birkskyum commented Aug 5, 2024

Figured it out now. Clap doesn't support two .long(), but it does allow an .alias() which is an extra hidden .long().

Copy link
Member

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crowlKats crowlKats merged commit 4c56353 into denoland:main Aug 8, 2024
17 checks passed
@birkskyum
Copy link
Contributor Author

birkskyum commented Aug 10, 2024

@crowlKats , do you think it makes sense, and is technically possible with clap, to add a deprecation note to the --env alias, so that it could be remove in favor of the --env-file at the 2.0 or later major release? just mentioning it because 2.0 is nearing so these considerations are better to have now

@crowlKats
Copy link
Member

@birkskyum clap itself can't do that, we'd have to do that ourselves (without much difficulty), however we are likely to keep it for the foreseeable future and then maybe remove it at some point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make deno --env-file work like --env
3 participants