Skip to content

Conversation

cjdoris
Copy link
Contributor

@cjdoris cjdoris commented Oct 16, 2025

For me --project is by far the most-used CLI option but it doesn't have a short version. This PR adds the alias -P so now you can do julia -P @foo, saving 7 precious keystrokes over julia --project=@foo.

Note that as a short option, the argument is required, so you cannot do julia -P, you must use julia -P @.. This is the same limitation as -O whose argument is optional when used in its long form.

This also updates the relevant bits of the --help string, docs and man page; and adds some tests by duplicating ones using --project.

" --help-hidden Print uncommon options not shown by `-h`\n\n"

// startup options
" --project[={<dir>|@temp|@.|@script[<rel>]}] Set <dir> as the active project/environment.\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this option is now quite long, I have indented the help text a little:

 -P, --project[={<dir>|@temp|@.|@script[<rel>]}]  Set <dir> as the active project/environment.
                                               Or, create a temporary environment with `@temp`
                                               The default @. option will search through parent
                                               directories until a Project.toml or JuliaProject.toml
                                               file is found. @script is similar, but searches up
                                               from the programfile or a path relative to
                                               programfile.
 -J, --sysimage <file>                         Start up with the given system image file
 -H, --home <dir>                              Set location of `julia` executable

Is this OK or would you rather realigning like this?

 -P, --project[={<dir>|@temp|@.|@script[<rel>]}]  Set <dir> as the active project/environment.
                                                  Or, create a temporary environment with `@temp`
                                                  The default @. option will search through parent
                                                  directories until a Project.toml or JuliaProject.toml
                                                  file is found. @script is similar, but searches up
                                                  from the programfile or a path relative to
                                                  programfile.
 -J, --sysimage <file>                            Start up with the given system image file
 -H, --home <dir>                                 Set location of `julia` executable

Or putting it all onto the next line like this?

 -P, --project[={<dir>|@temp|@.|@script[<rel>]}]
                                               Set <dir> as the active project/environment.
                                               Or, create a temporary environment with `@temp`
                                               The default @. option will search through parent
                                               directories until a Project.toml or JuliaProject.toml
                                               file is found. @script is similar, but searches up
                                               from the programfile or a path relative to
                                               programfile.
 -J, --sysimage <file>                         Start up with the given system image file
 -H, --home <dir>                              Set location of `julia` executable

@cjdoris
Copy link
Contributor Author

cjdoris commented Oct 17, 2025

The test failures look unrelated to this.

@LilithHafner
Copy link
Member

Seems quite reasonable to me. Tagging triage as this expands the public API.

@LilithHafner LilithHafner added triage This should be discussed on a triage call design Design of APIs or of the language itself feature Indicates new feature / enhancement requests labels Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Design of APIs or of the language itself feature Indicates new feature / enhancement requests triage This should be discussed on a triage call

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants