Description
Describe the problem
This is an architectural issue in the golang implementation of the CLI.
The cli
package should not use directly the arduino
package but it should use only the functions available through gRPC, implemented in the commands
package to avoid code duplication and re-implementation of the same functionality over and over.
To reproduce
The current instances of the above issue are here:
internal/cli/arguments/completion.go
access the package arduino/cores
:
- import:
- usage:
internal/cli/arguments/fqbn.go
access the packages arduino/cores
and arduino/sketch
- import:
arduino-cli/internal/cli/arguments/fqbn.go
Lines 21 to 22 in 82e6f5d
- use of
sketch
: - use of
arduino
: - use of
arduino
:
internal/cli/arguments/port.go
access arduino/discovery
and arduino/sketch
- imports:
arduino-cli/internal/cli/arguments/port.go
Lines 22 to 24 in 82e6f5d
- use of
sketch
: - use of
sketch
: - it completely duplicates a discovery-manager run loop to discover the ports:
arduino-cli/internal/cli/arguments/port.go
Lines 95 to 132 in 82e6f5d
cli/arguments/reference.go
uses arduino
to get an error object:
- use of
arduino
:
cli/arguments/sketch.go
uses arduino/sketch
:
- use of
sketch
:arduino-cli/internal/cli/arguments/sketch.go
Lines 46 to 47 in 82e6f5d
- use of
sketch
:
Expected behavior
Remove all direct access to the arduino
package using the gRPC commads implementation in commands
.
Arduino CLI version
nightly build
Operating system
N/A
Operating system version
Additional context
No response
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details