From 9193b03b696eb0f91eb0f7d1273b3aed38f514f5 Mon Sep 17 00:00:00 2001 From: Jose Garcia Date: Fri, 3 Sep 2021 12:40:01 -0400 Subject: [PATCH] introduce follow, deprecate tail --- cmd/ghcs/logs.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/ghcs/logs.go b/cmd/ghcs/logs.go index fd92ff739..69ec12c42 100644 --- a/cmd/ghcs/logs.go +++ b/cmd/ghcs/logs.go @@ -16,6 +16,7 @@ func newLogsCmd() *cobra.Command { var ( codespace string tail bool + follow bool ) log := output.NewLogger(os.Stdout, os.Stderr, false) @@ -29,12 +30,17 @@ func newLogsCmd() *cobra.Command { log.Println(" argument is deprecated. Use --codespace instead.") codespace = args[0] } - return logs(context.Background(), log, codespace, tail) + if tail { + log.Println("--tail flag is deprecated. Use --follow instead.") + follow = true + } + return logs(context.Background(), log, codespace, follow) }, } logsCmd.Flags().StringVarP(&codespace, "codespace", "c", "", "Name of the codespace") - logsCmd.Flags().BoolVarP(&tail, "tail", "t", false, "Tail the logs") + logsCmd.Flags().BoolVarP(&tail, "tail", "t", false, "Tail the logs (deprecated, use --follow)") + logsCmd.Flags().BoolVarP(&follow, "follow", "f", false, "Tail and follow the logs") return logsCmd }