aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-05 12:39:20 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-05 12:39:20 -0700
commitaf1f64d2448dc0fa6271533d1ad69ad9cd77c066 (patch)
tree3f6911eccac9ff16fdb8db788204d438320835e2
parentb10679fcf0932cda1391f0ebc8e42343522cac0f (diff)
downloadseaweedfs-af1f64d2448dc0fa6271533d1ad69ad9cd77c066.tar.xz
seaweedfs-af1f64d2448dc0fa6271533d1ad69ad9cd77c066.zip
change from 'weed tail' to 'weed watch'
-rw-r--r--weed/command/command.go2
-rw-r--r--weed/command/watch.go (renamed from weed/command/tail.go)22
2 files changed, 12 insertions, 12 deletions
diff --git a/weed/command/command.go b/weed/command/command.go
index a82f3cdd0..9a41a8a7c 100644
--- a/weed/command/command.go
+++ b/weed/command/command.go
@@ -24,7 +24,7 @@ var Commands = []*Command{
cmdScaffold,
cmdServer,
cmdShell,
- cmdTail,
+ cmdWatch,
cmdUpload,
cmdVersion,
cmdVolume,
diff --git a/weed/command/tail.go b/weed/command/watch.go
index e81a4cfe2..6a0f4e2aa 100644
--- a/weed/command/tail.go
+++ b/weed/command/watch.go
@@ -12,11 +12,11 @@ import (
)
func init() {
- cmdTail.Run = runTail // break init cycle
+ cmdWatch.Run = runWatch // break init cycle
}
-var cmdTail = &Command{
- UsageLine: "tail <wip> [-filer=localhost:8888]",
+var cmdWatch = &Command{
+ UsageLine: "watch <wip> [-filer=localhost:8888] [-target=/]",
Short: "see recent changes on a filer",
Long: `See recent changes on a filer.
@@ -24,19 +24,19 @@ var cmdTail = &Command{
}
var (
- tailFiler = cmdTail.Flag.String("filer", "localhost:8888", "filer hostname:port")
- tailTarget = cmdTail.Flag.String("target", "/", "a folder or file on filer")
+ watchFiler = cmdWatch.Flag.String("filer", "localhost:8888", "filer hostname:port")
+ watchTarget = cmdWatch.Flag.String("target", "/", "a folder or file on filer")
)
-func runTail(cmd *Command, args []string) bool {
+func runWatch(cmd *Command, args []string) bool {
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
- tailErr := pb.WithFilerClient(*tailFiler, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
+ watchErr := pb.WithFilerClient(*watchFiler, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
stream, err := client.ListenForEvents(context.Background(), &filer_pb.ListenForEventsRequest{
- ClientName: "tail",
- Directory: *tailTarget,
+ ClientName: "watch",
+ Directory: *watchTarget,
SinceNs: 0,
})
if err != nil {
@@ -55,8 +55,8 @@ func runTail(cmd *Command, args []string) bool {
}
})
- if tailErr != nil {
- fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
+ if watchErr != nil {
+ fmt.Printf("watch %s: %v\n", *watchFiler, watchErr)
}
return true