id = "wget" name = "GNU Wget" homepage = "https://www.gnu.org/software/wget/" description = "GNU Wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS." # wget2 is a separate program with its own ~/.wget2rc and is not this entry. executables = ["wget"] [dotfiles] # wget(1), FILES: "/usr/local/etc/wgetrc — Default location of the global # startup file. .wgetrc — User startup file." The global one is not user-level # and is not listed; the user one is read from the home directory. On Windows # wget looks for wget.ini beside the executable rather than in the profile, so # there is no second spelling here. paths = ["~/.wgetrc"] exclude = [] # wget(1) under --no-netrc: "By default .netrc file is searched for credentials # in case none have been passed on the command line", and the manual points at # it for storing passwords out of the process list. The whole file is logins # and passwords. # # ~/.wget-hsts, the HSTS database, is state wget rewrites itself, not # configuration, so it is neither synced nor listed here. secret = ["~/.netrc"] # Parsed at startup by a process that then exits. side_effect = false # https://www.gnu.org/software/wget/manual/html_node/Wgetrc-Commands.html # names each of these: "password = string — Specify password for both FTP and # HTTP file retrieval", plus the protocol-specific http_password, ftp_password # and proxy_password. Written one per line as `name = value`, so the prefix is # the directive itself. The matching user/http_user/ftp_user/proxy_user # directives are left out on purpose: `user` as a prefix would also swallow # `user_agent`, which is a preference every machine should keep. [[dotfiles.secret_paths]] file = "~/.wgetrc" match = { prefix = ["password", "http_password", "ftp_password", "proxy_password"] } # Same page: ca_certificate ("use file as the file with the bundle of # certificate authorities") and ca_directory both name a trust store installed # by this machine's package manager — /etc/ssl on one distro, a Homebrew prefix # on the next. Where the package manager puts that store is decided by the kind # of machine, so the two hold across every box of the same OS and architecture. [[dotfiles.machine_lines]] file = "~/.wgetrc" match = { prefix = ["ca_certificate", "ca_directory"] } scope = "platform" # dir_prefix is "the top of the directory tree", where downloads land, and # logfile is where wget's own log goes; both are absolute paths into this # machine's disk that the user chose, which is why they are a separate rule # from the trust store above — kept so the user can rebuild this box, applied # to no other. [[dotfiles.machine_lines]] file = "~/.wgetrc" match = { prefix = ["dir_prefix", "logfile"] } scope = "backup" [commands] format = 1 label = "Download with wget" description = "Download one or more URLs, optionally recursively. Authentication, cookies, FTP and certificate options are left out." quality = "ai-draft" base = "fig:wget" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/wget.ts" license = "MIT" [[commands.field]] id = "urls" label = "URLs" type = "url" position = 0 multiple = true sources = ["fig"] [[commands.field]] id = "output_document" label = "Output file" type = "path" option = ["-O"] path = { kind = "file", role = "output" } effect = "overwrite" sources = ["fig"] [[commands.field]] id = "directory_prefix" label = "Save into directory" type = "path" option = ["-P"] path = { kind = "directory", role = "output" } sources = ["fig"] [[commands.field]] id = "continue" label = "Resume partial download" type = "boolean" option = ["--continue", "-c"] sources = ["fig"] [[commands.field]] id = "no_clobber" label = "Skip existing files" type = "boolean" option = ["--no-clobber"] sources = ["fig"] [[commands.field]] id = "recursive" label = "Recursive" type = "boolean" option = ["--recursive", "-r"] sources = ["fig"] [[commands.field]] id = "level" label = "Recursion depth" description = "Maximum depth, or inf for unlimited." type = "string" option = ["-l"] sources = ["fig"] [[commands.field]] id = "no_parent" label = "Do not ascend to parent" type = "boolean" option = ["--no-parent"] sources = ["fig"] [[commands.field]] id = "mirror" label = "Mirror site" type = "boolean" option = ["--mirror", "-m"] sources = ["fig"] [[commands.field]] id = "page_requisites" label = "Get page requisites" type = "boolean" option = ["--page-requisites", "-p"] sources = ["fig"] [[commands.field]] id = "convert_links" label = "Convert links for local viewing" type = "boolean" option = ["--convert-links", "-k"] sources = ["fig"] [[commands.field]] id = "accept" label = "Accepted extensions" description = "Comma-separated list." type = "string" option = ["-A"] sources = ["fig"] [[commands.field]] id = "tries" label = "Retries" type = "integer" option = ["-t"] sources = ["fig"] [[commands.field]] id = "user_agent" label = "User agent" type = "string" option = ["-U"] sources = ["fig"] [[commands.field]] id = "quiet" label = "Quiet" type = "boolean" option = ["--quiet", "-q"] sources = ["fig"] [[commands.field]] id = "spider" label = "Check only, do not download" type = "boolean" option = ["--spider"] sources = ["fig"] [[commands.task]] id = "download" label = "Download files" fields = ["urls", "directory_prefix", "continue", "no_clobber"] required = ["urls"] [[commands.task]] id = "save_as" label = "Download to a file" fields = ["urls", "output_document", "continue"] required = ["urls", "output_document"] [[commands.task]] id = "mirror" label = "Mirror a site" fields = ["urls", "mirror", "convert_links", "page_requisites", "no_parent"] required = ["urls"] set = { mirror = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["urls", "output_document", "directory_prefix", "continue", "no_clobber", "mirror"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["level", "accept", "tries", "user_agent", "quiet", "spider", "recursive", "no_parent", "page_requisites", "convert_links"]