All Projects → kashav → ded

kashav / ded

Licence: MIT license
Find dead links in your source files.

Programming Languages

go
31211 projects - #10 most used programming language

ded

Build Status Go Report Card

Find dead links in your source files.

Contents

Install

Binaries

View latest release.

via Go

$ go get -u -v github.com/kshvmdn/ded/cmd/ded
$ which ded
$GOPATH/bin/ded

Build manually

$ git clone https://github.com/kshvmdn/ded.git $GOPATH/src/github.com/kshvmdn/ded
$ cd $_ # $GOPATH/src/github.com/kshvmdn/ded
$ go build -o ded -v github.com/kshvmdn/ded/cmd/ded

Usage

  • ded expects one or more files as input. It'll search these files for a list of valid URLs and report whether each URL resolves or not. View examples below.

    $ ded file ...
    ...
  • Use the -help flag to view the help dialogue.

    $ ded -help
    Usage of ded:
      -f string
            Output format (default "{{ .Filename }}:{{ .Line }}:{{ .Column }}: {{ .URL }} -> {{ .Result }}")
      -i string
            Regular expression to ignore
      -n    Hide "200 OK" responses
      -o string
            Output file or [stderr|stdout] (default "stdout")
      -v    Show version and exit
      -w int
            Number of workers (0 = number of CPUs)

Examples

  • Basic examples:

    $ ded main.go README.md
    ...
    $ ded ./**/*.go
    ...
    $ ls | xargs ded
    ...
    $ cat main.go | ded
    ...
  • Custom output format:

    $ ded -f "{{ .URL }} {{ .Result }}" main.go README.md
    https://github.com/kshvmdn 200 OK
    http://nba.com/kashav-madan 404 Not Found
    ...
  • Ignore a specific domain:

    $ ded -i "nba.com" main.go README.md
    main.go:95:4: https://github.com/kshvmdn -> 200 OK
    ...
  • Hide any URL that 200s:

    $ ded -n main.go README.md
    README.md:47:16: http://nba.com/kashav-madan -> 404 Not Found
    ...

Contribute

This project is completely open source, feel free to open an issue or submit a pull request.

Credits

ded was inspired by client9/misspell.

License

ded source code is released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].