Skip to content

list-bin should default to exe:, not pkg: #7326

Closed

Description

@dmwit

If package foo provides executables foo and bar, then cabal list-bin foo gives a message like this one:

cabal: The list-bin command is for finding a single binary at once. The target
'foo' refers to the package foo-0.0.1 which includes the
executable 'bar' and the executable 'foo'.

Sort of frustrating. A similar thing happens for cabal run. Commands like run and list-bin that are intended to choose executables should default to choosing executables over packages (or other components), possibly printing a warning (but not to the same handle the path goes to for list-bin). I haven't tested, but possibly there is a similar ambiguity problem for tests; if so, I think I'd want cabal test to prefer test: components to others with the same name. (Perhaps there should be a triage of all existing commands to see if there is a most natural class of targets for them!)

Activity

  1. edmundnoble commented on Mar 19, 2021

    @edmundnoble
    Contributor

    run and test should have already got this working. I tested it for run and it worked, there was no ambiguity. I submitted a PR for list-bin, which was the exception. @dmwit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions