BshConsole

A BeanShell console with history, autocompletion and more...

License

License

GroupId

GroupId

com.github.stefanofornari
ArtifactId

ArtifactId

bsh-console
Last Version

Last Version

1.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

BshConsole
A BeanShell console with history, autocompletion and more...
Project URL

Project URL

https://github.com/stefanofornari/xtest
Source Code Management

Source Code Management

https://github.com/stefanofornari/BshConsole

Download bsh-console

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.stefanofornari/bsh-console/ -->
<dependency>
    <groupId>com.github.stefanofornari</groupId>
    <artifactId>bsh-console</artifactId>
    <version>1.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.stefanofornari/bsh-console/
implementation 'com.github.stefanofornari:bsh-console:1.3.0'
// https://jarcasting.com/artifacts/com.github.stefanofornari/bsh-console/
implementation ("com.github.stefanofornari:bsh-console:1.3.0")
'com.github.stefanofornari:bsh-console:jar:1.3.0'
<dependency org="com.github.stefanofornari" name="bsh-console" rev="1.3.0">
  <artifact name="bsh-console" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.stefanofornari', module='bsh-console', version='1.3.0')
)
libraryDependencies += "com.github.stefanofornari" % "bsh-console" % "1.3.0"
[com.github.stefanofornari/bsh-console "1.3.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.jline : jline jar 3.9.0
org.apache-extras.beanshell : bsh jar 2.1.0-UNOFFICIAL-20180916
info.picocli : picocli jar 3.0.0
org.apache.commons : commons-lang3 jar 3.8.1
commons-io : commons-io jar 2.6

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 3.8.0
com.github.stefanofornari : xtest jar 2.1.0

Project Modules

There are no modules declared in this project.

BshConsole

A BeanShell console with history, vars/commands completion and more...

Relationship with Beanshell

This project is not a beanshell fork. Beanshell is the best Java interpreter out there, but it missed a modern command line console with arrows handling, history, auto-completion etc. BshConsole wishes to fill this gap.

Please note that BshConsole uses a specialization of the standard bsh.Interpreter, but it should be completely compatible. If you notice any difference in parsing/execution behaviour between Beanshell and BshConsole please file an issue.

Distribution

The easiest way to get BshConsole is to download the distribution package from maven central at https://repo1.maven.org/maven2/com/github/stefanofornari/bsh-console/ (pick the version and search for the tar.gz artifact).

A few instructions

  • Tab starts completion suggestions looking into class path for classes or beanshell commands and variables
  • ^C discards the input during parsing and try to stop the command in execution when parsing is done and there is code running
  • ^Z send the current execution command in background so that you can keep typing new commands; an identifier of the task is displayed in the status bar until the execution is completed.
  • In BshConsole the BeanShell variable bsh.propmt does not control the prompt anymore, use getBshPrompt() instead.
  • use cls() to clear the screen (since 1.2.0)

Building from source

You can build BshConsole from source as well, with the following caveat: BshConsole is based on the latest (HEAD/SNAPHOT) of Beanshell 2.1.0; this has not been released yet and is currently (Aug 4th, 2018) available only building from source as a maven snapshot. This prevented to release a version of BshConsole. To overcome this problem, BshConsole uses a released version of a Beanshell snapshot from the fork https://github.com/stefanofornari/beanshell. You should be able to replace a fresh build of the Beanshell jar into /lib without any problem. If you encounter any issues, please open a ticket. To deploy on maven central after releasing: mvn -Prelease-sign-artifacts package deploy -DskipTests

Versions

Version
1.3.0
1.2.1
1.2.0
1.1.0
1.0.0