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

don't show Environment: in versioninfo output when env is empty #27050

Merged
merged 1 commit into from
May 10, 2018

Conversation

JeffBezanson
Copy link
Member

No description provided.

env_strs = [String[ " $(k) = $(v)" for (k,v) in ENV if occursin(r"JULIA", k)];
(verbose ?
String[ " $(k) = $(v)" for (k,v) in ENV if occursin(r"PATH|FLAG|^TERM$|HOME", k)] :
[])]
Copy link
Member

Choose a reason for hiding this comment

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

Just a suggestion, take it or leave it, but it seems this might be a bit clearer/DRYer as

env_strs = ["$k = $v" for (k, v) in ENV if occursin("JULIA", k) || (verbose && occursin(r"PATH|FLAG|^TERM$|HOME", k))]

Copy link
Member Author

Choose a reason for hiding this comment

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

That occurred to me, but the old code printed all the JULIA variables first, so I figured I'd preserve that.

Copy link
Member

Choose a reason for hiding this comment

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

env_strs = ["$k = $v" for (k, v) in ENV if occursin("JULIA", k)]
if verbose
    append!(env_strs, ["$k = $v" for (k, v) in ENV if occursin(r"PATH|FLAG|^TERM$|HOME", k)])
end

?

Anyway, doesn't really matter.

@ararslan ararslan merged commit 6fb4569 into master May 10, 2018
@ararslan ararslan deleted the jb/versioninfoEnv branch May 10, 2018 21:21
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.

2 participants