#compdef trurl

_trurl() {
  _arguments -C \
    {-a,--append}'[Append data to a component]:component:(url scheme user password options host port path query fragment zoneid):data:' \
    '--accept-space[Try to accept spaces as part of the URL and instead URL encode accordingly]' \
    '--as-idn[Convert punycode ASCII hostname to its original International Domain Name in Unicode]' \
    '--curl[Only accept URL schemes supported by libcurl]' \
    '--default-port[Use the scheme'\''s default port number for URLs with a known scheme, and without explicit port number]' \
    {-f,--url-file}'[Read URLs to work on from the given file]:file:_files' \
    {-g,--get}'[Output text and URL data according to the provided format string]:format:' \
    {-h,--help}'[Show the help output]' \
    '--iterate[Set component to multiple values and output result once for each iteration]:component:(url scheme user password options host port path query fragment zoneid):list:' \
    '--json[Output all set components of the URLs as JSON objects]' \
    '--keep-port[Do not remove default port numbers from URLs with a known scheme]' \
    '--no-guess-scheme[Disable libcurl'\''s scheme guessing feature]' \
    '--punycode[Use punycode version of the hostname]' \
    '--qtrim[Trim data off a query]:what:' \
    '--query-separator[Specify the single letter used for separating query pairs]:letter:' \
    '--quiet[Suppress (some) notes and warnings]' \
    '--redirect[Redirect the URL to this new location]:URL:' \
    '--replace[Replace a URL query]:data:' \
    '--replace-append[Works the same as --replace, but appends a missing query string]:data:' \
    {-s,--set}'[Set this URL component]:component:(url scheme user password options host port path query fragment zoneid):data:' \
    '--sort-query[Sort "variable=content" tuplets in query component]' \
    '--url[Set the input URL to work with]:URL:' \
    '--urlencode[Output URL encoded version of components by default when using --get or --json]' \
    {-v,--version}'[Show version information and exit]' \
    '--flag' \
    '--verify[When a URL is provided, return error immediately if it does not parse as a valid URL]' \
    '*:file:_files'
}

_trurl
