Daml Options Syntax in the REPL

Just lurking in the REPL and it occurred to ask, about the rationale behind writing the ‘daml’ options as:

daml option not daml --option, except for daml --help ?

  • Java does java --option [arg]
  • Node does node -/--option [arg]
  • Python does python --option [arg]
  • Bash does bash --gnu_long_option

Was just interested in the back story :thinking:

2 Likes

Usually what comes after daml without the preceding -- is a (sub-)command (e.g. daml build), similar to what you would do in git (git fetch, git checkout, etc.).

The difference is shown in the help text itself:

> daml -h
Usage: daml COMMAND

Available options:
  -h,--help                Show this help text

Available commands:
  version                  Display Daml version information
  install                  Install the specified SDK version
  uninstall                Uninstall the specified SDK version
  ...

I guess daml help also makes sense, but historically the help text is often invoked with --help, so it makes sense to use this more or less common way of using it. The good thing is that any non-recognized command will make the help text show up, incidentally including daml help. :wink:

1 Like

Happy to have helped.

One further detail I forgot to mention is that an important difference between java, node, python and bash on one side and daml on the other is that the former invoke an interpreter, whereas the latter is a tool that offers a CLI to multiple components in an SDK. In Java they have two separate commands to compile (javac) and spin up a VM running the compiler output (java), we have a single command. It’s a matter of taste, I guess. I believe git made it more common to have this kind of approach, bundling several features in a single CLI.

2 Likes