Skip to content

Commit

Permalink
docs: update command doc generation
Browse files Browse the repository at this point in the history
Signed-off-by: Massimiliano Giovagnoli <[email protected]>
  • Loading branch information
maxgio92 committed Aug 23, 2023
1 parent 3a4099a commit 352431e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(foreach bin,$(bins),\

.PHONY: doc
doc:
@go run doc/doc.go
@go run docs/gen.go

.PHONY: build
build:
Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# wfind: like find but for web sites

`wfind` (world wide web find) search for files in a web site directory hierarchy over HTTP and HTTPS, through HTML references.
`wfind` (world wide web find) search for files in a web site directory hierarchy over HTTP, through HTML references.

The tool is inspired by GNU `find(1)` and `wget(1)`.

Expand All @@ -10,15 +10,7 @@ The tool is inspired by GNU `find(1)` and `wget(1)`.
wfind URL [flags]
```

#### Options

```
-h, --help help for wfind
-n, --name string Base of file name (the path with the leading directories removed) pattern.
-r, --recursive Whether to examine entries recursing into directories. Disable to behave like GNU find -maxdepth=0 option. (default true)
-t, --type string The file type
-v, --verbose Enable verbosity to log all visited HTTP(s) files
```
For details please read the CLI [documentation](./docs/wfind.md).

### In action

Expand Down
9 changes: 5 additions & 4 deletions cmd/find/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ func NewCmd() *cobra.Command {
}

cmd := &cobra.Command{
Use: "wfind URL",
Short: "Find folders and files in web sites using HTTP or HTTPS",
Args: cobra.MinimumNArgs(1),
RunE: o.Run,
Use: "wfind URL",
Short: "Find folders and files in web sites using HTTP or HTTPS",
DisableAutoGenTag: true,
Args: cobra.MinimumNArgs(1),
RunE: o.Run,
}

// General flags.
Expand Down
7 changes: 6 additions & 1 deletion doc/doc.go → docs/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ import (
)

func main() {
output.ExitOnErr(doc.GenMarkdownTree(find.NewCmd(), "./doc"))
output.ExitOnErr(doc.GenMarkdownTreeCustom(
find.NewCmd(),
"./docs",
func(s string) string { return "" },
func(s string) string { return s },
))
}
1 change: 0 additions & 1 deletion doc/wfind.md → docs/wfind.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ wfind URL [flags]
-v, --verbose Enable verbosity to log all visited HTTP(s) files
```

###### Auto generated by spf13/cobra on 23-Aug-2023

0 comments on commit 352431e

Please sign in to comment.