Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
c316b386
Commit
c316b386
authored
Nov 09, 2021
by
Umberto Baldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added info logging in every command for consistency
parent
e642f729
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
73 additions
and
20 deletions
+73
-20
cli/board/attach.go
cli/board/attach.go
+3
-0
cli/board/details.go
cli/board/details.go
+3
-0
cli/board/list.go
cli/board/list.go
+4
-0
cli/board/listall.go
cli/board/listall.go
+3
-0
cli/board/search.go
cli/board/search.go
+3
-0
cli/burnbootloader/burnbootloader.go
cli/burnbootloader/burnbootloader.go
+3
-0
cli/cache/clean.go
cli/cache/clean.go
+1
-1
cli/compile/compile.go
cli/compile/compile.go
+3
-0
cli/completion/completion.go
cli/completion/completion.go
+2
-0
cli/config/add.go
cli/config/add.go
+2
-0
cli/config/delete.go
cli/config/delete.go
+2
-0
cli/config/dump.go
cli/config/dump.go
+1
-1
cli/config/init.go
cli/config/init.go
+1
-0
cli/config/remove.go
cli/config/remove.go
+2
-0
cli/config/set.go
cli/config/set.go
+2
-0
cli/core/download.go
cli/core/download.go
+1
-1
cli/core/install.go
cli/core/install.go
+1
-1
cli/core/list.go
cli/core/list.go
+1
-1
cli/core/search.go
cli/core/search.go
+1
-1
cli/core/uninstall.go
cli/core/uninstall.go
+1
-1
cli/core/update_index.go
cli/core/update_index.go
+1
-1
cli/core/upgrade.go
cli/core/upgrade.go
+1
-1
cli/daemon/daemon.go
cli/daemon/daemon.go
+1
-0
cli/debug/debug.go
cli/debug/debug.go
+2
-0
cli/generatedocs/generatedocs.go
cli/generatedocs/generatedocs.go
+1
-0
cli/lib/check_deps.go
cli/lib/check_deps.go
+2
-0
cli/lib/download.go
cli/lib/download.go
+2
-0
cli/lib/examples.go
cli/lib/examples.go
+1
-1
cli/lib/install.go
cli/lib/install.go
+2
-0
cli/lib/list.go
cli/lib/list.go
+1
-1
cli/lib/search.go
cli/lib/search.go
+2
-1
cli/lib/uninstall.go
cli/lib/uninstall.go
+2
-2
cli/lib/update_index.go
cli/lib/update_index.go
+1
-1
cli/lib/upgrade.go
cli/lib/upgrade.go
+1
-0
cli/monitor/monitor.go
cli/monitor/monitor.go
+2
-0
cli/outdated/outdated.go
cli/outdated/outdated.go
+1
-1
cli/sketch/archive.go
cli/sketch/archive.go
+1
-1
cli/sketch/new.go
cli/sketch/new.go
+2
-0
cli/update/update.go
cli/update/update.go
+1
-1
cli/upgrade/upgrade.go
cli/upgrade/upgrade.go
+1
-1
cli/upload/upload.go
cli/upload/upload.go
+2
-0
cli/version/version.go
cli/version/version.go
+2
-0
commands/lib/download.go
commands/lib/download.go
+1
-1
No files found.
cli/board/attach.go
View file @
c316b386
...
...
@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/cli/output"
"github.com/arduino/arduino-cli/commands/board"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -51,6 +52,8 @@ func initAttachCommand() *cobra.Command {
func
runAttachCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli board attach`"
)
path
:=
""
if
len
(
args
)
>
1
{
path
=
args
[
1
]
...
...
cli/board/details.go
View file @
c316b386
...
...
@@ -28,6 +28,7 @@ import (
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table"
"github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -58,6 +59,8 @@ func initDetailsCommand() *cobra.Command {
func
runDetailsCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli board details`"
)
// remove once `board details <fqbn>` is removed
if
fqbn
.
String
()
==
""
&&
len
(
args
)
>
0
{
fqbn
.
Set
(
args
[
0
])
...
...
cli/board/list.go
View file @
c316b386
...
...
@@ -28,6 +28,7 @@ import (
"github.com/arduino/arduino-cli/commands/board"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -57,6 +58,9 @@ func initListCommand() *cobra.Command {
// runListCommand detects and lists the connected arduino boards
func
runListCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli board list`"
)
if
watch
{
watchList
(
cmd
,
inst
)
os
.
Exit
(
0
)
...
...
cli/board/listall.go
View file @
c316b386
...
...
@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/commands/board"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -52,6 +53,8 @@ for a specific board if you specify the board name`),
func
runListAllCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli board listall`"
)
list
,
err
:=
board
.
ListAll
(
context
.
Background
(),
&
rpc
.
BoardListAllRequest
{
Instance
:
inst
,
SearchArgs
:
args
,
...
...
cli/board/search.go
View file @
c316b386
...
...
@@ -28,6 +28,7 @@ import (
"github.com/arduino/arduino-cli/commands/board"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -50,6 +51,8 @@ for a specific board if you specify the board name`),
func
runSearchCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli board search`"
)
res
,
err
:=
board
.
Search
(
context
.
Background
(),
&
rpc
.
BoardSearchRequest
{
Instance
:
inst
,
SearchArgs
:
strings
.
Join
(
args
,
" "
),
...
...
cli/burnbootloader/burnbootloader.go
View file @
c316b386
...
...
@@ -26,6 +26,7 @@ import (
"github.com/arduino/arduino-cli/commands/upload"
"github.com/arduino/arduino-cli/i18n"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -64,6 +65,8 @@ func NewCommand() *cobra.Command {
func
runBootloaderCommand
(
command
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli burn-bootloader`"
)
// We don't need a Sketch to upload a board's bootloader
discoveryPort
,
err
:=
port
.
GetPort
(
instance
,
nil
)
if
err
!=
nil
{
...
...
cli/cache/clean.go
View file @
c316b386
...
...
@@ -38,7 +38,7 @@ func initCleanCommand() *cobra.Command {
}
func
runCleanCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino cache clean`"
)
logrus
.
Info
(
"Executing `arduino
-cli
cache clean`"
)
cachePath
:=
configuration
.
Settings
.
GetString
(
"directories.Downloads"
)
err
:=
os
.
RemoveAll
(
cachePath
)
...
...
cli/compile/compile.go
View file @
c316b386
...
...
@@ -26,6 +26,7 @@ import (
"github.com/arduino/arduino-cli/cli/output"
"github.com/arduino/arduino-cli/configuration"
"github.com/arduino/arduino-cli/i18n"
"github.com/sirupsen/logrus"
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/instance"
...
...
@@ -123,6 +124,8 @@ func NewCommand() *cobra.Command {
func
runCompileCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli compile`"
)
path
:=
""
if
len
(
args
)
>
0
{
path
=
args
[
0
]
...
...
cli/completion/completion.go
View file @
c316b386
...
...
@@ -21,6 +21,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/i18n"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -47,6 +48,7 @@ func NewCommand() *cobra.Command {
}
func
runCompletionCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli completion`"
)
if
completionNoDesc
&&
(
args
[
0
]
==
"powershell"
)
{
feedback
.
Errorf
(
tr
(
"Error: command description is not supported by %v"
),
args
[
0
])
os
.
Exit
(
errorcodes
.
ErrGeneric
)
...
...
cli/config/add.go
View file @
c316b386
...
...
@@ -22,6 +22,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -43,6 +44,7 @@ func initAddCommand() *cobra.Command {
}
func
runAddCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli config add`"
)
key
:=
args
[
0
]
kind
:=
validateKey
(
key
)
...
...
cli/config/delete.go
View file @
c316b386
...
...
@@ -22,6 +22,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
...
...
@@ -44,6 +45,7 @@ func initDeleteCommand() *cobra.Command {
}
func
runDeleteCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli config delete`"
)
toDelete
:=
args
[
0
]
keys
:=
[]
string
{}
...
...
cli/config/dump.go
View file @
c316b386
...
...
@@ -38,7 +38,7 @@ func initDumpCommand() *cobra.Command {
}
func
runDumpCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino config dump`"
)
logrus
.
Info
(
"Executing `arduino
-cli
config dump`"
)
feedback
.
PrintResult
(
dumpResult
{
configuration
.
Settings
.
AllSettings
()})
}
...
...
cli/config/init.go
View file @
c316b386
...
...
@@ -59,6 +59,7 @@ func initInitCommand() *cobra.Command {
}
func
runInitCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli config init`"
)
var
configFileAbsPath
*
paths
.
Path
var
absPath
*
paths
.
Path
...
...
cli/config/remove.go
View file @
c316b386
...
...
@@ -22,6 +22,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -43,6 +44,7 @@ func initRemoveCommand() *cobra.Command {
}
func
runRemoveCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli config remove`"
)
key
:=
args
[
0
]
kind
:=
validateKey
(
key
)
...
...
cli/config/set.go
View file @
c316b386
...
...
@@ -23,6 +23,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -46,6 +47,7 @@ func initSetCommand() *cobra.Command {
}
func
runSetCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli config set`"
)
key
:=
args
[
0
]
kind
:=
validateKey
(
key
)
...
...
cli/core/download.go
View file @
c316b386
...
...
@@ -51,7 +51,7 @@ func initDownloadCommand() *cobra.Command {
func
runDownloadCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino core download`"
)
logrus
.
Info
(
"Executing `arduino
-cli
core download`"
)
platformsRefs
,
err
:=
arguments
.
ParseReferences
(
args
,
true
)
if
err
!=
nil
{
...
...
cli/core/install.go
View file @
c316b386
...
...
@@ -59,7 +59,7 @@ func initInstallCommand() *cobra.Command {
func
runInstallCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino core install`"
)
logrus
.
Info
(
"Executing `arduino
-cli
core install`"
)
platformsRefs
,
err
:=
arguments
.
ParseReferences
(
args
,
true
)
if
err
!=
nil
{
...
...
cli/core/list.go
View file @
c316b386
...
...
@@ -50,7 +50,7 @@ func initListCommand() *cobra.Command {
func
runListCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino core list`"
)
logrus
.
Info
(
"Executing `arduino
-cli
core list`"
)
platforms
,
err
:=
core
.
GetPlatforms
(
&
rpc
.
PlatformListRequest
{
Instance
:
inst
,
...
...
cli/core/search.go
View file @
c316b386
...
...
@@ -82,7 +82,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
}
arguments
:=
strings
.
ToLower
(
strings
.
Join
(
args
,
" "
))
logrus
.
Infof
(
"Executing `arduino core search` with args: '%s'"
,
arguments
)
logrus
.
Infof
(
"Executing `arduino
-cli
core search` with args: '%s'"
,
arguments
)
resp
,
err
:=
core
.
PlatformSearch
(
&
rpc
.
PlatformSearchRequest
{
Instance
:
inst
,
...
...
cli/core/uninstall.go
View file @
c316b386
...
...
@@ -48,7 +48,7 @@ func initUninstallCommand() *cobra.Command {
func
runUninstallCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino core uninstall`"
)
logrus
.
Info
(
"Executing `arduino
-cli
core uninstall`"
)
platformsRefs
,
err
:=
arguments
.
ParseReferences
(
args
,
true
)
if
err
!=
nil
{
...
...
cli/core/update_index.go
View file @
c316b386
...
...
@@ -42,8 +42,8 @@ func initUpdateIndexCommand() *cobra.Command {
}
func
runUpdateIndexCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino core update-index`"
)
inst
:=
instance
.
CreateInstanceAndRunFirstUpdate
()
logrus
.
Info
(
"Executing `arduino-cli core update-index`"
)
_
,
err
:=
commands
.
UpdateIndex
(
context
.
Background
(),
&
rpc
.
UpdateIndexRequest
{
Instance
:
inst
,
...
...
cli/core/upgrade.go
View file @
c316b386
...
...
@@ -51,7 +51,7 @@ func initUpgradeCommand() *cobra.Command {
func
runUpgradeCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino core upgrade`"
)
logrus
.
Info
(
"Executing `arduino
-cli
core upgrade`"
)
// if no platform was passed, upgrade allthethings
if
len
(
args
)
==
0
{
...
...
cli/daemon/daemon.go
View file @
c316b386
...
...
@@ -67,6 +67,7 @@ func NewCommand() *cobra.Command {
}
func
runDaemonCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli daemon`"
)
if
configuration
.
Settings
.
GetBool
(
"metrics.enabled"
)
{
metrics
.
Activate
(
"daemon"
)
...
...
cli/debug/debug.go
View file @
c316b386
...
...
@@ -31,6 +31,7 @@ import (
"github.com/arduino/arduino-cli/table"
"github.com/arduino/go-properties-orderedmap"
"github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -67,6 +68,7 @@ func NewCommand() *cobra.Command {
func
runDebugCommand
(
command
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli debug`"
)
path
:=
""
if
len
(
args
)
>
0
{
...
...
cli/generatedocs/generatedocs.go
View file @
c316b386
...
...
@@ -58,6 +58,7 @@ func NewCommand() *cobra.Command {
}
func
generateBashCompletions
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli generate-docs`"
)
if
outputDir
==
""
{
outputDir
=
"docs/bash_completions"
}
...
...
cli/lib/check_deps.go
View file @
c316b386
...
...
@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/commands/lib"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -49,6 +50,7 @@ func initDepsCommand() *cobra.Command {
func
runDepsCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli lib deps`"
)
libRef
,
err
:=
ParseLibraryReferenceArgAndAdjustCase
(
instance
,
args
[
0
])
if
err
!=
nil
{
feedback
.
Errorf
(
tr
(
"Arguments error: %v"
),
err
)
...
...
cli/lib/download.go
View file @
c316b386
...
...
@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/cli/output"
"github.com/arduino/arduino-cli/commands/lib"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -49,6 +50,7 @@ func initDownloadCommand() *cobra.Command {
func
runDownloadCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli lib download`"
)
refs
,
err
:=
ParseLibraryReferenceArgsAndAdjustCase
(
instance
,
args
)
if
err
!=
nil
{
feedback
.
Errorf
(
tr
(
"Invalid argument passed: %v"
),
err
)
...
...
cli/lib/examples.go
View file @
c316b386
...
...
@@ -56,7 +56,7 @@ func initExamplesCommand() *cobra.Command {
func
runExamplesCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"
Show examples for library
"
)
logrus
.
Info
(
"
Executing `arduino-cli lib examples`
"
)
name
:=
""
if
len
(
args
)
>
0
{
...
...
cli/lib/install.go
View file @
c316b386
...
...
@@ -31,6 +31,7 @@ import (
"github.com/arduino/arduino-cli/configuration"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
semver
"go.bug.st/relaxed-semver"
)
...
...
@@ -65,6 +66,7 @@ func initInstallCommand() *cobra.Command {
func
runInstallCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli lib install`"
)
if
zipPath
||
gitURL
{
if
!
configuration
.
Settings
.
GetBool
(
"library.enable_unsafe_install"
)
{
...
...
cli/lib/list.go
View file @
c316b386
...
...
@@ -58,7 +58,7 @@ not listed, they can be listed by adding the --all flag.`),
func
runListCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"
Listing
"
)
logrus
.
Info
(
"
Executing `arduino-cli lib list`
"
)
name
:=
""
if
len
(
args
)
>
0
{
...
...
cli/lib/search.go
View file @
c316b386
...
...
@@ -53,6 +53,8 @@ func initSearchCommand() *cobra.Command {
func
runSearchCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
,
status
:=
instance
.
Create
()
logrus
.
Info
(
"Executing `arduino-cli lib search`"
)
if
status
!=
nil
{
feedback
.
Errorf
(
tr
(
"Error creating instance: %v"
),
status
)
os
.
Exit
(
errorcodes
.
ErrGeneric
)
...
...
@@ -71,7 +73,6 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
feedback
.
Errorf
(
tr
(
"Error initializing instance: %v"
),
err
)
}
logrus
.
Info
(
"Executing `arduino lib search`"
)
searchResp
,
err
:=
lib
.
LibrarySearch
(
context
.
Background
(),
&
rpc
.
LibrarySearchRequest
{
Instance
:
inst
,
Query
:
(
strings
.
Join
(
args
,
" "
)),
...
...
cli/lib/uninstall.go
View file @
c316b386
...
...
@@ -47,9 +47,9 @@ func initUninstallCommand() *cobra.Command {
}
func
runUninstallCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino lib uninstall`"
)
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli lib uninstall`"
)
refs
,
err
:=
ParseLibraryReferenceArgsAndAdjustCase
(
instance
,
args
)
if
err
!=
nil
{
feedback
.
Errorf
(
tr
(
"Invalid argument passed: %v"
),
err
)
...
...
cli/lib/update_index.go
View file @
c316b386
...
...
@@ -42,8 +42,8 @@ func initUpdateIndexCommand() *cobra.Command {
}
func
runUpdateIndexCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino lib update-index`"
)
inst
:=
instance
.
CreateInstanceAndRunFirstUpdate
()
logrus
.
Info
(
"Executing `arduino-cli lib update-index`"
)
err
:=
commands
.
UpdateLibrariesIndex
(
context
.
Background
(),
&
rpc
.
UpdateLibrariesIndexRequest
{
Instance
:
inst
,
...
...
cli/lib/upgrade.go
View file @
c316b386
...
...
@@ -43,6 +43,7 @@ func initUpgradeCommand() *cobra.Command {
func
runUpgradeCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli lib upgrade`"
)
if
len
(
args
)
==
0
{
err
:=
lib
.
LibraryUpgradeAll
(
instance
.
Id
,
output
.
ProgressBar
(),
output
.
TaskProgress
())
...
...
cli/monitor/monitor.go
View file @
c316b386
...
...
@@ -34,6 +34,7 @@ import (
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table"
"github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -68,6 +69,7 @@ func NewCommand() *cobra.Command {
func
runMonitorCmd
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli monitor`"
)
if
!
configuration
.
HasConsole
{
quiet
=
true
...
...
cli/outdated/outdated.go
View file @
c316b386
...
...
@@ -48,7 +48,7 @@ that can be upgraded. If nothing needs to be updated the output is empty.`),
func
runOutdatedCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino outdated`"
)
logrus
.
Info
(
"Executing `arduino
-cli
outdated`"
)
outdatedResp
,
err
:=
commands
.
Outdated
(
context
.
Background
(),
&
rpc
.
OutdatedRequest
{
Instance
:
inst
,
...
...
cli/sketch/archive.go
View file @
c316b386
...
...
@@ -54,7 +54,7 @@ func initArchiveCommand() *cobra.Command {
}
func
runArchiveCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino sketch archive`"
)
logrus
.
Info
(
"Executing `arduino
-cli
sketch archive`"
)
sketchPath
:=
paths
.
New
(
"."
)
if
len
(
args
)
>=
1
{
...
...
cli/sketch/new.go
View file @
c316b386
...
...
@@ -26,6 +26,7 @@ import (
sk
"github.com/arduino/arduino-cli/commands/sketch"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
paths
"github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -42,6 +43,7 @@ func initNewCommand() *cobra.Command {
}
func
runNewCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli sketch new`"
)
// Trim to avoid issues if user creates a sketch adding the .ino extesion to the name
sketchName
:=
args
[
0
]
trimmedSketchName
:=
strings
.
TrimSuffix
(
sketchName
,
globals
.
MainFileValidExtension
)
...
...
cli/update/update.go
View file @
c316b386
...
...
@@ -52,8 +52,8 @@ var updateFlags struct {
}
func
runUpdateCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino update`"
)
inst
:=
instance
.
CreateInstanceAndRunFirstUpdate
()
logrus
.
Info
(
"Executing `arduino-cli update`"
)
err
:=
commands
.
UpdateCoreLibrariesIndex
(
context
.
Background
(),
&
rpc
.
UpdateCoreLibrariesIndexRequest
{
Instance
:
inst
,
...
...
cli/upgrade/upgrade.go
View file @
c316b386
...
...
@@ -52,7 +52,7 @@ func NewCommand() *cobra.Command {
func
runUpgradeCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
inst
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino upgrade`"
)
logrus
.
Info
(
"Executing `arduino
-cli
upgrade`"
)
err
:=
commands
.
Upgrade
(
context
.
Background
(),
&
rpc
.
UpgradeRequest
{
Instance
:
inst
,
...
...
cli/upload/upload.go
View file @
c316b386
...
...
@@ -26,6 +26,7 @@ import (
"github.com/arduino/arduino-cli/commands/upload"
"github.com/arduino/arduino-cli/i18n"
rpc
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -69,6 +70,7 @@ func NewCommand() *cobra.Command {
func
runUploadCommand
(
command
*
cobra
.
Command
,
args
[]
string
)
{
instance
:=
instance
.
CreateAndInit
()
logrus
.
Info
(
"Executing `arduino-cli upload`"
)
path
:=
""
if
len
(
args
)
>
0
{
...
...
cli/version/version.go
View file @
c316b386
...
...
@@ -24,6 +24,7 @@ import (
"github.com/arduino/arduino-cli/cli/globals"
"github.com/arduino/arduino-cli/cli/updater"
"github.com/arduino/arduino-cli/i18n"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
semver
"go.bug.st/relaxed-semver"
)
...
...
@@ -44,6 +45,7 @@ func NewCommand() *cobra.Command {
}
func
runVersionCommand
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
logrus
.
Info
(
"Executing `arduino-cli version`"
)
if
strings
.
Contains
(
globals
.
VersionInfo
.
VersionString
,
"git-snapshot"
)
||
strings
.
Contains
(
globals
.
VersionInfo
.
VersionString
,
"nightly"
)
{
// We're using a development version, no need to check if there's a
// new release available
...
...
commands/lib/download.go
View file @
c316b386
...
...
@@ -31,7 +31,7 @@ var tr = i18n.Tr
// LibraryDownload FIXMEDOC
func
LibraryDownload
(
ctx
context
.
Context
,
req
*
rpc
.
LibraryDownloadRequest
,
downloadCB
commands
.
DownloadProgressCB
)
(
*
rpc
.
LibraryDownloadResponse
,
error
)
{
logrus
.
Info
(
"Executing `arduino lib download`"
)
logrus
.
Info
(
"Executing `arduino
-cli
lib download`"
)
lm
:=
commands
.
GetLibraryManager
(
req
.
GetInstance
()
.
GetId
())
if
lm
==
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment