diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-09-18 21:42:06 +0200 |
|---|---|---|
| committer | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-09-18 21:42:06 +0200 |
| commit | c6950bcd5cd8fe9e7cc63fde7216a5a9b93b8aa0 (patch) | |
| tree | 9df22d313d935b6b0b9ff870ea89d9e9437a96b1 /cmd | |
| parent | becbf4bf3981a3f8d9a57864942ca1468e23a6b0 (diff) | |
rename watch command to dev
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/flyscrape/dev.go (renamed from cmd/flyscrape/watch.go) | 14 | ||||
| -rw-r--r-- | cmd/flyscrape/main.go | 6 |
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:]) } |