Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know available commands (=named operations) in sbt

Tags:

sbt

I use sbt 0.13.1.

To list the tasks in a sbt project, one can use sbt tasks -V.

As A "command" looks similar to a task: it's a named operation that can be executed from the sbt console and Typically, you would resort to a command when you need to do something that's impossible in a regular task, how can I know what commands are available for a sbt project?

Is there a similar command to list all of the commands in a sbt project?

Say, the sbt-idea plugin's installed in a sbt project. How could I query the project to find out about the gen-idea command?

It's so confusing given the comment of @Mark Harrah: "gen-idea is a command, not a task." and the documentation of the sbt-idea plugin where it says "Use the gen-idea sbt task to create Idea project files." (note the use of task). I am confused.

like image 386
Jacek Laskowski Avatar asked Oct 20 '13 11:10

Jacek Laskowski


2 Answers

Doesn't "help" without any arguments do that? From my understanding "tasks" without any arguments will list available tasks and "help" w/o arguments will do a similar things for commands.

like image 194
Mateusz Dymczyk Avatar answered Nov 08 '22 06:11

Mateusz Dymczyk


I'd argue it's an implementation detail.

Do you have a real use case where you require to list only commands? :-)

-- Update 1:

sbt
$ <tab><tab>
Display all 339 possibilities? (y or n) [y]
# ... 
gen-idea
# ...

Simply tabbing in the terminal gives you all actions you can perform, including gen-idea - your use-case.

like image 2
Konrad 'ktoso' Malawski Avatar answered Nov 08 '22 05:11

Konrad 'ktoso' Malawski