Class VariableCommands

java.lang.Object
org.jline.shell.impl.VariableCommands
All Implemented Interfaces:
CommandGroup

public class VariableCommands extends Object implements CommandGroup
Built-in commands for managing session variables: set, unset, and export.

  • set ? list all session variables, or set one (set NAME=VALUE or set NAME VALUE)
  • unset NAME ? remove a session variable
  • export NAME=VALUE ? same as set NAME=VALUE
Since:
4.0
  • Constructor Details

    • VariableCommands

      public VariableCommands()
      Creates a new VariableCommands group.
  • Method Details

    • name

      public String name()
      Description copied from interface: CommandGroup
      Returns the name of this command group.

      The default implementation returns the simple class name.

      Specified by:
      name in interface CommandGroup
      Returns:
      the group name
    • commands

      public List<Command> commands()
      Description copied from interface: CommandGroup
      Returns all commands in this group.
      Specified by:
      commands in interface CommandGroup
      Returns:
      the collection of commands, never null
    • command

      public Command command(String name)
      Description copied from interface: CommandGroup
      Finds a command by name or alias.

      The default implementation scans CommandGroup.commands() for a match.

      Specified by:
      command in interface CommandGroup
      Parameters:
      name - the command name or alias
      Returns:
      the command, or null if not found