Skip to content

Conversation

stellartux
Copy link
Contributor

This commit implements @project_version, a macro which reads the version number from a Project.toml file for use with the version argument of the ArgParseSettings function. This keeps the version returned by ArgParse in sync with the project's version automatically.

@carlobaldassi
Copy link
Owner

Looks good, thanks. It should be mentioned in the documentation too though.

@stellartux
Copy link
Contributor Author

I'd added the docstring to the Settings page. Should I make a separate page for it or write more documentation?

@carlobaldassi
Copy link
Owner

Ah right I had missed it, sorry.

@carlobaldassi carlobaldassi merged commit 8b3cce9 into carlobaldassi:master Apr 6, 2021
@GunnarFarneback
Copy link

GunnarFarneback commented Jul 1, 2025

Why is there a Base.current_project() default? This could be absolutely anything, depending on where the current directory happens to be, which is not necessarily aligned with the package code. It could also be nothing and causing a cryptic error, if the current directory (and its parents) doesn't have a Project.toml, which is the case when running automerge checks for the General registry.

It would seem better to just give an error if no file is provided, but I guess that would be a breaking change at this point. Or have a default that actually does make something sensible, but I'm not sure if that's possible (short of insane hacks to try to deduce the caller from the backtrace).

@GunnarFarneback
Copy link

Actually I don't figure how the macro could be used in a good way with arguments either, see #136.

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.

3 participants