Skip to content

Commit

Permalink
Improve help message (#115)
Browse files Browse the repository at this point in the history
* Improve help message

* Bump version
  • Loading branch information
raviqqe authored Sep 27, 2020
1 parent 9a67319 commit d8ed8a1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
44 changes: 24 additions & 20 deletions .snapshots/TestHelp
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@ Usage:
muffet.test [options] <url>

Application Options:
-b, --buffer-size= HTTP response buffer size in bytes (default:
4096)
-c, --max-connections= Maximum number of HTTP connections (default:
512)
--max-connections-per-host= Maximum number of HTTP connections per host
(default: 512)
-e, --exclude= Exclude URLs matched with given regular
expressions
--follow-robots-txt Follow robots.txt when scraping pages
--follow-sitemap-xml Scrape only pages listed in sitemap.xml
--header= Custom headers
-f, --ignore-fragments Ignore URL fragments
-r, --max-redirections= Maximum number of redirections (default: 64)
-t, --timeout= Timeout for HTTP requests in seconds
(default: 10)
-v, --verbose Show successful results too
--skip-tls-verification Skip TLS certificate verification
--one-page-only Only check links found in the given URL
-h, --help Show this help
--version Show version
-b, --buffer-size=<size> HTTP response buffer size in bytes
(default: 4096)
-c, --max-connections=<count> Maximum number of HTTP connections
(default: 512)
--max-connections-per-host=<count> Maximum number of HTTP connections
per host (default: 512)
-e, --exclude=<pattern>... Exclude URLs matched with given
regular expressions
--follow-robots-txt Follow robots.txt when scraping
pages
--follow-sitemap-xml Scrape only pages listed in
sitemap.xml
--header=<header>... Custom headers
-f, --ignore-fragments Ignore URL fragments
-r, --max-redirections=<count> Maximum number of redirections
(default: 64)
-t, --timeout=<seconds> Timeout for HTTP requests in
seconds (default: 10)
-v, --verbose Show successful results too
--skip-tls-verification Skip TLS certificate verification
--one-page-only Only check links found in the given
URL
-h, --help Show this help
--version Show version

14 changes: 7 additions & 7 deletions arguments.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
)

type arguments struct {
BufferSize int `short:"b" long:"buffer-size" default:"4096" description:"HTTP response buffer size in bytes"`
MaxConnections int `short:"c" long:"max-connections" default:"512" description:"Maximum number of HTTP connections"`
MaxConnectionsPerHost int `long:"max-connections-per-host" default:"512" description:"Maximum number of HTTP connections per host"`
RawExcludedPatterns []string `short:"e" long:"exclude" description:"Exclude URLs matched with given regular expressions"`
BufferSize int `short:"b" long:"buffer-size" value-name:"<size>" default:"4096" description:"HTTP response buffer size in bytes"`
MaxConnections int `short:"c" long:"max-connections" value-name:"<count>" default:"512" description:"Maximum number of HTTP connections"`
MaxConnectionsPerHost int `long:"max-connections-per-host" value-name:"<count>" default:"512" description:"Maximum number of HTTP connections per host"`
RawExcludedPatterns []string `short:"e" long:"exclude" value-name:"<pattern>..." description:"Exclude URLs matched with given regular expressions"`
FollowRobotsTxt bool `long:"follow-robots-txt" description:"Follow robots.txt when scraping pages"`
FollowSitemapXML bool `long:"follow-sitemap-xml" description:"Scrape only pages listed in sitemap.xml"`
RawHeaders []string `long:"header" description:"Custom headers"`
RawHeaders []string `long:"header" value-name:"<header>..." description:"Custom headers"`
IgnoreFragments bool `short:"f" long:"ignore-fragments" description:"Ignore URL fragments"`
MaxRedirections int `short:"r" long:"max-redirections" default:"64" description:"Maximum number of redirections"`
Timeout int `short:"t" long:"timeout" default:"10" description:"Timeout for HTTP requests in seconds"`
MaxRedirections int `short:"r" long:"max-redirections" value-name:"<count>" default:"64" description:"Maximum number of redirections"`
Timeout int `short:"t" long:"timeout" value-name:"<seconds>" default:"10" description:"Timeout for HTTP requests in seconds"`
Verbose bool `short:"v" long:"verbose" description:"Show successful results too"`
SkipTLSVerification bool `long:"skip-tls-verification" description:"Skip TLS certificate verification"`
OnePageOnly bool `long:"one-page-only" description:"Only check links found in the given URL"`
Expand Down
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import "time"

const (
version = "2.0.4"
version = "2.0.5"
agentName = "muffet"
concurrency = 1024
tcpTimeout = time.Minute
Expand Down

0 comments on commit d8ed8a1

Please sign in to comment.