ex_slp v0.1.1 ExSlp.Tool

Summary

Functions

Executes slptool command cmd with args as command arguments and opts as the list of post-command options. Returns:

{ :ok, response } # in case of success,
{ :error, message } # otherwise

Returns a string that is used for invoking the slptool. By default this is simply “slptool” per the standard debian package name, but config.exs may override the value

Checks the status of slptool on the current system. Returns:

{ :ok, message } # in case of success
{ :not_executable, message }
# in case the tool is installed but is not executable by the current user
{ :error, message } # otherwise

Gets the current slp toolkit version. Returns:

  { major, minor, patch } # if the toolkit is installed
  nil # otherwise

Example:

  ExSlp.Tool.version
  > { 1, 2, 1 }

Functions

exec_cmd(args, cmd)

Executes slptool command cmd with args as command arguments and opts as the list of post-command options. Returns:

{ :ok, response } # in case of success,
{ :error, message } # otherwise.
exec_cmd(args, cmd, opts)
slptool()

Returns a string that is used for invoking the slptool. By default this is simply “slptool” per the standard debian package name, but config.exs may override the value

status()

Checks the status of slptool on the current system. Returns:

{ :ok, message } # in case of success
{ :not_executable, message }
# in case the tool is installed but is not executable by the current user
{ :error, message } # otherwise
version()

Gets the current slp toolkit version. Returns:

  { major, minor, patch } # if the toolkit is installed
  nil # otherwise

Example:

  ExSlp.Tool.version
  > { 1, 2, 1 }

  case ExSlp.Tool.version do
    { 1, _, _ } -> # do v1 specific things
    { 2, _, _ } -> # do v2 specific things
  end