diff --git a/README.md b/README.md index bd052d5..2ca0a6e 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ -# linkcheck +# liche -[![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/linkcheck.svg?style=flat-square)](https://circleci.com/gh/raviqqe/linkcheck) -[![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/linkcheck?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/linkcheck) -[![License](https://img.shields.io/github/license/raviqqe/linkcheck.svg?style=flat-square)](LICENSE) +[![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/liche.svg?style=flat-square)](https://circleci.com/gh/raviqqe/liche) +[![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/liche?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/liche) +[![License](https://img.shields.io/github/license/raviqqe/liche.svg?style=flat-square)](LICENSE) -`linkcheck` is a command line tool to check links in Markdown and HTML files. +`liche` is a command line tool to check links in Markdown and HTML files. It checks all `a` and `img` tags in specified files. ## Installation ```sh -go get -u github.com/raviqqe/linkcheck +go get -u github.com/raviqqe/liche ``` ## Usage ```sh -linkcheck file.md -linkcheck file1.md file2.md +liche file.md +liche file1.md file2.md ``` ## License diff --git a/arguments.go b/arguments.go index 509fe03..61d980c 100644 --- a/arguments.go +++ b/arguments.go @@ -10,7 +10,7 @@ import ( const usage = `Link checker for Markdown and HTML Usage: - linkcheck [-t ] [-v] ... + liche [-t ] [-v] ... Options: -v, --verbose Be verbose @@ -23,7 +23,7 @@ type arguments struct { } func getArgs() (arguments, error) { - args, err := docopt.Parse(usage, nil, true, "linkcheck", true) + args, err := docopt.Parse(usage, nil, true, "liche", true) if err != nil { return arguments{}, err diff --git a/examples/error.feature b/examples/error.feature index efadd9d..7bdfe7e 100644 --- a/examples/error.feature +++ b/examples/error.feature @@ -1,11 +1,11 @@ Feature: Error Scenario: Fail with no argument Given a file named "foo.md" with "" - When I run `linkcheck` + When I run `liche` Then the exit status should be 1 Scenario: Fail with a non-existent file Given a file named "foo.md" with "" - When I run `linkcheck bar.md` + When I run `liche bar.md` Then the exit status should be 1 And the stderr should contain "no such file" diff --git a/examples/markdown.feature b/examples/markdown.feature index ab7f9b0..420d4b5 100644 --- a/examples/markdown.feature +++ b/examples/markdown.feature @@ -1,7 +1,7 @@ Feature: Markdown Scenario: Check an empty markdown file Given a file named "foo.md" with "" - When I successfully run `linkcheck foo.md` + When I successfully run `liche foo.md` Then the stdout should contain exactly "" Scenario: Check a markdown file @@ -22,7 +22,7 @@ Feature: Markdown echo Hello, world! ``` """ - When I successfully run `linkcheck foo.md` + When I successfully run `liche foo.md` Then the stdout should contain exactly "" Scenario: Check a markdown file which contains a live link @@ -30,7 +30,7 @@ Feature: Markdown """ [Google](https://google.com) """ - When I successfully run `linkcheck foo.md` + When I successfully run `liche foo.md` Then the stdout should contain exactly "" Scenario: Check a markdown file which contains a dead link @@ -38,7 +38,7 @@ Feature: Markdown """ [The answer](https://some-say-the-answer-is-42.com) """ - When I run `linkcheck foo.md` + When I run `liche foo.md` Then the exit status should be 1 And the stderr should contain "ERROR" @@ -48,7 +48,7 @@ Feature: Markdown [Google](https://google.com) [The answer](https://some-say-the-answer-is-42.com) """ - When I run `linkcheck foo.md` + When I run `liche foo.md` Then the exit status should be 1 And the stderr should not contain "OK" And the stderr should contain "ERROR" @@ -58,7 +58,7 @@ Feature: Markdown """ [Google](https://google.com) """ - When I successfully run `linkcheck -v foo.md` + When I successfully run `liche -v foo.md` Then the stderr should contain "OK" Scenario: Check a markdown file which contains a live link in verbose mode with a long option @@ -66,7 +66,7 @@ Feature: Markdown """ [Google](https://google.com) """ - When I successfully run `linkcheck --verbose foo.md` + When I successfully run `liche --verbose foo.md` Then the stderr should contain "OK" Scenario: Check a markdown file which contains live and dead links in verbose mode @@ -75,7 +75,7 @@ Feature: Markdown [Google](https://google.com) [The answer](https://some-say-the-answer-is-42.com) """ - When I run `linkcheck -v foo.md` + When I run `liche -v foo.md` Then the exit status should be 1 And the stderr should contain "OK" And the stderr should contain "ERROR" @@ -89,18 +89,18 @@ Feature: Markdown """ [Yahoo](https://yahoo.com) """ - When I successfully run `linkcheck foo.md bar.md` + When I successfully run `liche foo.md bar.md` Then the stdout should contain exactly "" Scenario: Check 2 markdown files Given a file named "foo.md" with: """ - [![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/linkcheck.svg?style=flat-square)](https://circleci.com/gh/raviqqe/linkcheck) - [![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/linkcheck?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/linkcheck) + [![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/liche.svg?style=flat-square)](https://circleci.com/gh/raviqqe/liche) + [![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/liche?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/liche) """ And a file named "foo.sh" with: """ - linkcheck -v foo.md 2>&1 | wc -l + liche -v foo.md 2>&1 | wc -l """ When I successfully run `sh foo.sh` Then the stdout should contain exactly "5" @@ -110,5 +110,5 @@ Feature: Markdown """ [Google](https://google.com) """ - When I successfully run `linkcheck --timeout 10 foo.md` + When I successfully run `liche --timeout 10 foo.md` Then the stdout should contain exactly "" diff --git a/rakefile.rb b/rakefile.rb index 00a5a76..a8ffe7e 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -9,7 +9,7 @@ task :deps do end task :build do - sh 'go build -o bin/linkcheck' + sh 'go build -o bin/liche' end task :fast_unit_test do