Skip to content

Commit c8edd76

Browse files
committed
use a better naming for output functions
1 parent 683e53e commit c8edd76

23 files changed

+56
-29
lines changed

cli/board/attach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func runAttachCommand(cmd *cobra.Command, args []string) {
6161
BoardUri: args[0],
6262
SketchPath: path,
6363
SearchTimeout: attachFlags.searchTimeout,
64-
}, output.OutputTaskProgress())
64+
}, output.TaskProgress())
6565
if err != nil {
6666
formatter.PrintError(err, "attach board error")
6767
os.Exit(errorcodes.ErrGeneric)

cli/board/details.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func runDetailsCommand(cmd *cobra.Command, args []string) {
5050
formatter.PrintError(err, "Error getting board details")
5151
os.Exit(errorcodes.ErrGeneric)
5252
}
53-
if output.OutputJSONOrElse(res) {
53+
if output.JSONOrElse(res) {
5454
outputDetailsResp(res)
5555
}
5656
}

cli/board/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func runListCommand(cmd *cobra.Command, args []string) {
6767
os.Exit(errorcodes.ErrNetwork)
6868
}
6969

70-
if output.OutputJSONOrElse(resp) {
70+
if output.JSONOrElse(resp) {
7171
outputListResp(resp)
7272
}
7373
}

cli/board/listall.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func runListAllCommand(cmd *cobra.Command, args []string) {
5858
os.Exit(errorcodes.ErrGeneric)
5959
}
6060

61-
if output.OutputJSONOrElse(list) {
61+
if output.JSONOrElse(list) {
6262
outputBoardListAll(list)
6363
}
6464
}

cli/core/download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) {
5858
Architecture: platformRef.Architecture,
5959
Version: platformRef.Version,
6060
}
61-
_, err := core.PlatformDownload(context.Background(), platformDownloadreq, output.OutputProgressBar(),
61+
_, err := core.PlatformDownload(context.Background(), platformDownloadreq, output.ProgressBar(),
6262
globals.HTTPClientHeader)
6363
if err != nil {
6464
formatter.PrintError(err, "Error downloading "+args[i])

cli/core/install.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func runInstallCommand(cmd *cobra.Command, args []string) {
6060
Architecture: platformRef.Architecture,
6161
Version: platformRef.Version,
6262
}
63-
_, err := core.PlatformInstall(context.Background(), plattformInstallReq, output.OutputProgressBar(),
64-
output.OutputTaskProgress(), globals.HTTPClientHeader)
63+
_, err := core.PlatformInstall(context.Background(), plattformInstallReq, output.ProgressBar(),
64+
output.TaskProgress(), globals.HTTPClientHeader)
6565
if err != nil {
6666
formatter.PrintError(err, "Error during install")
6767
os.Exit(errorcodes.ErrGeneric)

cli/core/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func runListCommand(cmd *cobra.Command, args []string) {
6464
}
6565
installed := resp.GetInstalledPlatform()
6666
if installed != nil && len(installed) > 0 {
67-
if output.OutputJSONOrElse(installed) {
67+
if output.JSONOrElse(installed) {
6868
outputInstalledCores(installed)
6969
}
7070
}

cli/core/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
6363
}
6464

6565
coreslist := resp.GetSearchOutput()
66-
if output.OutputJSONOrElse(coreslist) {
66+
if output.JSONOrElse(coreslist) {
6767
if len(coreslist) > 0 {
6868
outputSearchCores(coreslist)
6969
} else {

cli/core/update_index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func runUpdateIndexCommand(cmd *cobra.Command, args []string) {
4949

5050
_, err := commands.UpdateIndex(context.Background(), &rpc.UpdateIndexReq{
5151
Instance: instance,
52-
}, output.OutputProgressBar())
52+
}, output.ProgressBar())
5353
if err != nil {
5454
formatter.PrintError(err, "Error updating index")
5555
os.Exit(errorcodes.ErrGeneric)

cli/core/upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) {
6363
Instance: instance,
6464
PlatformPackage: platformRef.Package,
6565
Architecture: platformRef.Architecture,
66-
}, output.OutputProgressBar(), output.OutputTaskProgress(),
66+
}, output.ProgressBar(), output.TaskProgress(),
6767
globals.HTTPClientHeader)
6868
if err != nil {
6969
formatter.PrintError(err, "Error during upgrade")

0 commit comments

Comments
 (0)