You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/07/22 00:55:58 UTC

[GitHub] [skywalking-cli] fgksgf commented on a change in pull request #101: Set display

fgksgf commented on a change in pull request #101:
URL: https://github.com/apache/skywalking-cli/pull/101#discussion_r674434320



##########
File path: pkg/display/display.go
##########
@@ -56,3 +67,22 @@ func Display(ctx *cli.Context, displayable *d.Displayable) error {
 		return fmt.Errorf("unsupported display style: %s", displayStyle)
 	}
 }
+
+// getDisplay gets the default display settings.
+func getDisplay(fullName string) string {
+	// The variable displaystyle sets the input command and the corresponding output format.
+	var style = [][]string{{"dashboard global", "graph"},
+		{"dashboard global-metrics", "graph"},
+		{"metrics top", "table"},
+		{"metrics linear", "graph"},
+		{"metrics list", "table"},
+		{"service list", "table"},
+		{"t", "graph"},
+		{"trace", "graph"}}

Review comment:
       I suggest moving it out of the function and use `map[string]string` to maintain the display style. The above comment seems to be inconsistent.

##########
File path: pkg/display/display.go
##########
@@ -56,3 +67,22 @@ func Display(ctx *cli.Context, displayable *d.Displayable) error {
 		return fmt.Errorf("unsupported display style: %s", displayStyle)
 	}
 }
+
+// getDisplay gets the default display settings.
+func getDisplay(fullName string) string {

Review comment:
       `getDisplayStyle` may be more explicit




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org