matheuswhite / scope-rs

Multiplatform Serial Monitor made in Rust
BSD 3-Clause "New" or "Revised" License
9 stars 2 forks source link

Plugin auto complete system #77

Closed matheuswhite closed 1 month ago

matheuswhite commented 3 months ago

Dependencies

matheuswhite commented 3 months ago

List of commands

The plugin should implement a function help that returns a table with supported commands. The table must obey the following format:

function scope.help()
  return {
    {'connect', scope.arg('dev_name', scope.dyn)},
    {'disconnect'},
    {'write', scope.arg('characteristic', scope.dyn), scope.arg('data', scope.str)}
    {'read', scope.arg('characteristic', scope.dyn)},
    {'track', scope.arg('characteristic', scope.dyn), scope.arg('mode', scope.options('last', 'all'))},
  }
end

Types of arguments

Resolve the dynamic argument

function scope.resolve(command, argument)
  if argument == 'characteristic' then
    return scope.ble_chars()
  end
end
matheuswhite commented 3 months ago

Do help for !plugin inside the program

matheuswhite commented 1 month ago

It'll be made on #98