Skip to content

Included targets in cabal's bash-completion. #1932

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

Merged
merged 3 commits into from
Jul 15, 2014

Conversation

rudymatela
Copy link
Contributor

When commpleting for cabal build/repl/test/bench, this completes the possible
targets depending on their types. This is a temporary workaround, the
definitive solution would be to include those targets in cabal itself, via
``--list-options''.

In other words, when typing "cabal repl [tab]", only option arguments (starting with --) are offered for completion. This commit solves that by adding possible targets to the list.

As mentioned before, this is a temporary workaround, code searches in current directory for a ".cabal" file and "parses" it to know which targets to complete.

This partially solves issue #1382

When commpleting for cabal build/repl/test/bench, this completes the possible
targets depending on their types.  This is a temporary workaround, the
definitive solution would be to include those targets in cabal itself, via
``--list-options''.
@dcoutts
Copy link
Contributor

dcoutts commented Jun 21, 2014

Does this do completion for exes or the lib too? From the code it looks like it only does testsuites or benchmarks. Also is it case insensitive? We can have "benchmark" or "Benchmark" (or even "beNCHmark") in .cabal files.

Now handling executables:
	- completing run target
	- completing executables on build target

Improvements:
	- removed false positives on completion
@rudymatela
Copy link
Contributor Author

@dcoutts, I've added a new commit:

  • Now completing executables
  • Now completing also for "cabal run"
  • Now case insensitive
  • Removed false positives (more strict matching)

About the completion for libraries, I'm unsure about how it should work: cabal build will already build the libraries without need of completion, cabal repl will load them. But maybe there is a use case that I'm missing.

@23Skidoo
Copy link
Member

OK, I think this can be merged.

@rudymatela Thanks for your contribution!

@23Skidoo 23Skidoo closed this Jul 15, 2014
@23Skidoo 23Skidoo reopened this Jul 15, 2014
23Skidoo added a commit that referenced this pull request Jul 15, 2014
Included targets in cabal's bash-completion.
@23Skidoo 23Skidoo merged commit a2a9eca into haskell:master Jul 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants