summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Tanlak <philipp.tanlak@gmail.com>2023-09-18 21:42:06 +0200
committerPhilipp Tanlak <philipp.tanlak@gmail.com>2023-09-18 21:42:06 +0200
commitc6950bcd5cd8fe9e7cc63fde7216a5a9b93b8aa0 (patch)
tree9df22d313d935b6b0b9ff870ea89d9e9437a96b1
parentbecbf4bf3981a3f8d9a57864942ca1468e23a6b0 (diff)
rename watch command to dev
-rw-r--r--README.md6
-rw-r--r--cmd/flyscrape/dev.go (renamed from cmd/flyscrape/watch.go)14
-rw-r--r--cmd/flyscrape/main.go6
3 files changed, 13 insertions, 13 deletions
diff --git a/README.md b/README.md
index 295d29f..3d06b1c 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ flyscrape is an elegant scraping tool for efficiently extracting data from websi
- **Run Scripts**: Execute your scraping script using the `run` command, and watch as **flyscrape** retrieves and processes data from the specified website.
-- **Watch for Development**: The `watch` command allows you to watch your scraping script for changes and quickly iterate during development, helping you find the right data extraction queries.
+- **Watch for Development**: The `dev` command allows you to watch your scraping script for changes and quickly iterate during development, helping you find the right data extraction queries.
## Installation
@@ -46,10 +46,10 @@ flyscrape run example.js
### Watching for Development
-The `watch` command allows you to watch your scraping script for changes and quickly iterate during development:
+The `dev` command allows you to watch your scraping script for changes and quickly iterate during development:
```bash
-flyscrape watch example.js
+flyscrape dev example.js
```
## Example Script
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:])
}