如何在 sbt 中显示命令详细信息?
How to show commands details in sbt?
在 sbt 中 commands
显示带有默认非描述性 toString
的列表
> commands
[info] List(sbt.SimpleCommand@46fb833a, sbt.SimpleCommand@2a64793e, sbt.SimpleCommand@2a53eb30, sbt.SimpleCommand@6b75b205)
如何遍历列表并显示命令名称?
这是 0.13.9 中的 known issue, which will be fixed。
作为权宜之计,您可以在 consoleProject
中执行类似的操作:
commands.eval map { c =>
ReflectUtilities fields c.getClass get "name" map { f =>
f setAccessible true
f get c toString
} getOrElse c.toString
}
在 sbt 中 commands
显示带有默认非描述性 toString
> commands
[info] List(sbt.SimpleCommand@46fb833a, sbt.SimpleCommand@2a64793e, sbt.SimpleCommand@2a53eb30, sbt.SimpleCommand@6b75b205)
如何遍历列表并显示命令名称?
这是 0.13.9 中的 known issue, which will be fixed。
作为权宜之计,您可以在 consoleProject
中执行类似的操作:
commands.eval map { c =>
ReflectUtilities fields c.getClass get "name" map { f =>
f setAccessible true
f get c toString
} getOrElse c.toString
}