Skip to content

Make dune exec pick the executable automatically when it is unambiguous #14510

@Leonidas-from-XIV

Description

@Leonidas-from-XIV

Desired Behavior

dune exec is an useful command for running binaries and making sure that the binaries that are run are up-to-date (thus preferable to dune build followed by _build/default/install/bin/...). However in my experience it is unnecessarily strict on what inputs it accepts when it could (in my opinion) fairly reasonably infer what the user wants to do in a number of common cases.

At the moment dune exec requires an argument. However if the project just has one (public?) executable, it would be convenient if dune exec just picked that executable automatically. My assumption here is that a lot of simple projects only have one single executable, thus this would make it easier for a lot of people as they don't need to look up and specify the executable anymore.

Example

(executable
  (public_name foo))
$ dune exec

builds and executes foo automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalRFC's that are awaiting discussion to be accepted or rejected

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions