summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/flyscrape/dev.go (renamed from cmd/flyscrape/watch.go)14
-rw-r--r--cmd/flyscrape/main.go6
2 files changed, 10 insertions, 10 deletions
diff --git a/cmd/flyscrape/watch.go b/cmd/flyscrape/dev.go
index b8e3c37..85ac1a1 100644
--- a/cmd/flyscrape/watch.go
+++ b/cmd/flyscrape/dev.go
@@ -13,10 +13,10 @@ import (
"github.com/philippta/flyscrape"
)
-type WatchCommand struct{}
+type DevCommand struct{}
-func (c *WatchCommand) Run(args []string) error {
- fs := flag.NewFlagSet("flyscrape-watch", flag.ContinueOnError)
+func (c *DevCommand) Run(args []string) error {
+ fs := flag.NewFlagSet("flyscrape-dev", flag.ContinueOnError)
proxy := fs.String("proxy", "", "proxy")
fs.Usage = c.Usage
@@ -82,19 +82,19 @@ func (c *WatchCommand) Run(args []string) error {
return nil
}
-func (c *WatchCommand) Usage() {
+func (c *DevCommand) Usage() {
fmt.Println(`
-The watch command watches the scraping script and re-runs it on any change.
+The dev command watches the scraping script and re-runs it on any change.
Recursive scraping is disabled in this mode, only the initial URL will be scraped.
Usage:
- flyscrape watch SCRIPT
+ flyscrape dev SCRIPT
Examples:
# Run and watch script.
- $ flyscrape watch example.js
+ $ flyscrape dev example.js
`[1:])
}
diff --git a/cmd/flyscrape/main.go b/cmd/flyscrape/main.go
index 4470717..4e448bb 100644
--- a/cmd/flyscrape/main.go
+++ b/cmd/flyscrape/main.go
@@ -38,8 +38,8 @@ func (m *Main) Run(args []string) error {
return (&NewCommand{}).Run(args)
case "run":
return (&RunCommand{}).Run(args)
- case "watch":
- return (&WatchCommand{}).Run(args)
+ case "dev":
+ return (&DevCommand{}).Run(args)
default:
if cmd == "" || cmd == "help" || strings.HasPrefix(cmd, "-") {
m.Usage()
@@ -61,6 +61,6 @@ Commands:
new creates a sample scraping script
run runs a scraping script
- watch watches and re-runs a scraping script
+ dev watches and re-runs a scraping script
`[1:])
}