Skip to content

Commit

Permalink
fix: fix spell
Browse files Browse the repository at this point in the history
  • Loading branch information
kemokemo committed Jun 23, 2020
1 parent 3fbd96a commit 22153f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ Get the latest version from [the release page](https://github.com/kemokemo/htmld
```sh
$ htmldiff -h
Usage: htmldiff [<option>...] <old html> <new html>
-ah
true: use after header, false: use before header (default true)
-h display help
-nh
true: use new header, false: use old header (default true)
-o string
output filename (default "diff.html")
output filename (default "diff.html")j
```

When comparing two html files, you need to choose which header to use. By default, it uses the header of the html file specified in `--after`. To use the header of `--before` specifies `--ah` as an argument, as shown below. ( `--ah` is a flag that means "use **a**fter html's **h**eader". )
When comparing two html files, you need to choose which header to use. By default, it uses the new header. To use the header of the old html file, set `-nh=false` flag. ( `-nh` means "use **n**ew **h**eader". )

### Example

```sh
htmldiff -o=diff/index.html v1/index.html v2/index.html
```

If you use the header of `v1/index.html`, set `-ah=false` flag.
If you use the header of `v1/index.html`, set `-nh=false` flag.

```sh
htmldiff -o=diff/index.html -ah=false v1/index.html v2/index.html
htmldiff -o=diff/index.html -nh=false v1/index.html v2/index.html
```

## Information for developers
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const (
)

var (
out string
useAfterHeader bool
help bool
out string
useNewHeader bool
help bool
)

func init() {
flag.StringVar(&out, "o", "diff.html", "output filename")
flag.BoolVar(&useAfterHeader, "ah", true, "true: use after header, false: use before header")
flag.BoolVar(&useNewHeader, "nh", true, "true: use new header, false: use old header")
flag.BoolVar(&help, "h", false, "display help")
flag.Parse()
}
Expand Down Expand Up @@ -80,7 +80,7 @@ func run() int {
}

header := bytes.NewBufferString("")
if useAfterHeader {
if useNewHeader {
header = nHeader
} else {
header = oHeader
Expand Down

0 comments on commit 22153f7

Please sign in to comment.