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

Add --version CLI flag #556

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Add --version CLI flag #556

merged 2 commits into from
Aug 27, 2024

Conversation

jiribenes
Copy link
Contributor

@jiribenes jiribenes commented Aug 26, 2024

Resolves #540

Scallop already supports printing out a version just by calling version(<your version identifier>) (see docs here), let's just use it :)

Usage

$ effekt --version
Effekt 0.99.99+nightly

(I changed my version in build.sbt in order to make this very visible)

Help page

The version also gets printed out on --help:

$ effekt --help
Effekt 0.99.99+nightly
 Common Options
  -c, --compile                  Compile the Effekt program to the backend
                                 specific representation
      --no-compile
  -b, --build                    Compile the Effekt program and build a backend
                                 specific executable
      --nobuild
  -o, --out  <arg>               Path to write generated files to (defaults to
                                 ./out)
      --includes  <arg>...       Path to consider for includes (can be set
                                 multiple times)
  -l, --lib  <arg>               Path to the standard library to be used
      --backend  <arg>           The backend that should be used Choices: js,
                                 js-web, chez-callcc, chez-monadic, chez-lift,
                                 llvm, ml

Note that we could add a larger "Usage: effekt ..."-style banner, see here.

@jiribenes jiribenes added the feature New feature or request label Aug 26, 2024
@b-studios
Copy link
Collaborator

b-studios commented Aug 26, 2024

Ah you already discuss the prefixing in the PR description...

But many tools already prefix it, like javac, git, brew, pdflatex, ...

@jiribenes
Copy link
Contributor Author

jiribenes commented Aug 26, 2024

I'm also perfectly fine with somebody else going through the alternative solutions linked in the PR description, my requirements right now are:

  • that effekt --version really prints only the version, as it really makes everything much easier when working with external tools (VSCode, JS, /bin/sh, ...), and
  • that this gets merged soon in order to unblock the rest of the related PRs.

To be more specific, I could see somebody implementing the prefixing, but than someone else needs to go ahead and handle this in all of the tooling.

@b-studios
Copy link
Collaborator

b-studios commented Aug 26, 2024

I agree it is simpler to process, but you probably need to parse the version anyways, no? If not, then lexicographic ordering would also work for a stable prefix, still.

I am just saying: I know how to strip a prefix in javascript (version.replace("Effekt ", "")), but don't know whether it is possible to configure Scallop the right way without forking it.

@jiribenes
Copy link
Contributor Author

jiribenes commented Aug 26, 2024

It complicates the tooling [IMO a bit unnecessarily], but I really need this PR to go through to unblock the other ones, so I'll concede the point and just do Effekt 0.1.2.3 instead (see the updated PR description).

Now the question is: are we happy with this format? It will be really difficult to change it afterwards, so please, if there's anybody who wants the output to look differently, now's your chance, please speak up!

@b-studios
Copy link
Collaborator

You can also just go with the version number and I'll ask the Scallop developer to help us.

@b-studios
Copy link
Collaborator

I don't have a strong preference so choose what you prefer and I'll handle the rest :)

@jiribenes
Copy link
Contributor Author

jiribenes commented Aug 26, 2024

I went ahead and customised all of the tooling so that it can handle a prefix, now I just want some confidence vote on the specific prefix to be used so that I don't have to support multiple different ones in the future.

... so, does anybody want a different format?

@b-studios b-studios merged commit f2152e2 into master Aug 27, 2024
2 checks passed
@b-studios b-studios deleted the feature/version branch August 27, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --version CLI flag
2 participants