Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
306 changes: 0 additions & 306 deletions cmd/arduino-app-cli/board/board.go

This file was deleted.

2 changes: 0 additions & 2 deletions cmd/arduino-app-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"go.bug.st/cleanup"

"github.com/arduino/arduino-app-cli/cmd/arduino-app-cli/app"
"github.com/arduino/arduino-app-cli/cmd/arduino-app-cli/board"
"github.com/arduino/arduino-app-cli/cmd/arduino-app-cli/brick"
"github.com/arduino/arduino-app-cli/cmd/arduino-app-cli/completion"
"github.com/arduino/arduino-app-cli/cmd/arduino-app-cli/config"
Expand Down Expand Up @@ -78,7 +77,6 @@ func run(configuration cfg.Configuration) error {
properties.NewPropertiesCmd(configuration),
config.NewConfigCmd(configuration),
system.NewSystemCmd(configuration),
board.NewBoardCmd(),
version.NewVersionCmd(Version),
)

Expand Down
31 changes: 25 additions & 6 deletions cmd/arduino-app-cli/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ func NewSystemCmd(cfg config.Configuration) *cobra.Command {
Use: "system",
}

cmd.AddCommand(newDownloadImage(cfg))
cmd.AddCommand(newDownloadImageCmd(cfg))
cmd.AddCommand(newUpdateCmd())
cmd.AddCommand(newCleanUpCmd(cfg, servicelocator.GetDockerClient()))
cmd.AddCommand(newNetworkMode())
cmd.AddCommand(newkeyboardSet())
cmd.AddCommand(newNetworkModeCmd())
cmd.AddCommand(newKeyboardSetCmd())
cmd.AddCommand(newBoardSetNameCmd())

return cmd
}

func newDownloadImage(cfg config.Configuration) *cobra.Command {
func newDownloadImageCmd(cfg config.Configuration) *cobra.Command {
cmd := &cobra.Command{
Use: "init",
Args: cobra.ExactArgs(0),
Expand Down Expand Up @@ -173,7 +174,7 @@ func newCleanUpCmd(cfg config.Configuration, docker command.Cli) *cobra.Command
return cmd
}

func newNetworkMode() *cobra.Command {
func newNetworkModeCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "network-mode <enable|disable|status>",
Short: "Manage the network mode of the system",
Expand Down Expand Up @@ -209,7 +210,7 @@ func newNetworkMode() *cobra.Command {
return cmd
}

func newkeyboardSet() *cobra.Command {
func newKeyboardSetCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "keyboard [layout]",
Short: "Manage the keyboard layout of the system",
Expand Down Expand Up @@ -250,3 +251,21 @@ func newkeyboardSet() *cobra.Command {

return cmd
}

func newBoardSetNameCmd() *cobra.Command {
setNameCmd := &cobra.Command{
Use: "set-name <name>",
Short: "Set the custom name of the board",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
name := args[0]
if err := board.SetCustomName(cmd.Context(), &local.LocalConnection{}, name); err != nil {
return fmt.Errorf("failed to set custom name: %w", err)
}
feedback.Printf("Custom name set to %q\n", name)
return nil
},
}

return setNameCmd
}
Loading