Skip to content

Conversation

@GunnarFarneback
Copy link

  • Document @project_version as deprecated since there is no way to use it correctly short of providing a literal absolute path. The problem is that the result depends on the user's current directory, which doesn't necessarily have any relation to the location of the code using ArgParse.
  • Export the project_version function, which can be used correctly in conjunction with @__DIR__. Extend it to handle a directory input.
  • Allow the version argument of the ArgParseSettings constructor to take a VersionNumber, to better support the pkgversion function.

Footnote: With ArgParse 1.2, the following constructions can be used in place of @project_version, the last one on Julia 1.9+ in a package.

    ArgParseSettings(add_version = true, version = ArgParse.project_version(Base.current_project(@__DIR__)))
    ArgParseSettings(add_version = true, version = ArgParse.project_version(joinpath(@__DIR__, "..", "Project.toml")))
    ArgParseSettings(add_version = true, version = string(pkgversion(@__MODULE__)))

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.

1 participant