Full Code of fnichol/names for AI

main b5023b03e233 cached
30 files
121.8 KB
37.2k tokens
22 symbols
1 requests
Download .txt
Repository: fnichol/names
Branch: main
Commit: b5023b03e233
Files: 30
Total size: 121.8 KB

Directory structure:
gitextract__nxd32rv/

├── .ci/
│   ├── build-cargo-make.ps1
│   ├── build-cargo-make.sh
│   ├── build-checksums.ps1
│   ├── build-checksums.sh
│   ├── build-docker-image.sh
│   ├── cirrus-release.sh
│   ├── install-cargo-make.ps1
│   ├── install-cargo-make.sh
│   └── names.manifest.txt
├── .cirrus.yml
├── .gitattributes
├── .github/
│   └── bors.toml
├── .gitignore
├── .prettierrc.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── Cargo.toml
├── LICENSE.txt
├── Makefile.toml
├── README.md
├── README.tpl
├── build.rs
├── data/
│   ├── adjectives.txt
│   └── nouns.txt
├── docs/
│   └── install.sh
├── release.toml
├── src/
│   ├── bin/
│   │   └── names.rs
│   └── lib.rs
├── tests/
│   └── version-numbers.rs
└── vendor/
    └── cargo-make/
        └── Makefile.common.toml

================================================
FILE CONTENTS
================================================

================================================
FILE: .ci/build-cargo-make.ps1
================================================
#!/usr/bin/env powershell

<#
.SYNOPSIS
Builds cargo-make into a dedicated directory for caching

.DESCRIPTION
The script will run `cargo install <PLUGIN>` to target a non-default directory,
allowing a user to cache the installation directory for caching in a CI
context. The executables in the `bin` directory are linked back into
`$env:CARGO_HOME\bin` so that no further PATH manipulation is necessary.

.EXAMPLE
.\build-cargo-make.ps1
#>

param (
)

function main() {
    if (Test-Path env:CARGO_HOME) {
        $dest = "$env:CARGO_HOME"
    } elseif (Test-Path env:USERPROFILE) {
        $dest = "$env:USERPROFILE\.cargo"
    } elseif (Test-Path env:HOME) {
        $dest = "$env:HOME\.cargo"
    } else {
        throw "cannot determine CARGO_HOME"
    }

    Install-CargoMake "$dest"
}

function Install-CargoMake([string]$Dest) {
    $plugin = "cargo-make"

    Write-Output "--- Building $plugin in $Dest"

    if (-Not (Test-Path "$Dest")) {
        New-Item -Type Directory "$Dest" | Out-Null
    }
    rustup install stable
    cargo +stable install --root "$Dest\opt\$plugin" --force --verbose "$plugin"

    # Create symbolic links for all execuatbles into $env:CARGO_HOME\bin
    Get-ChildItem "$Dest\opt\$plugin\bin\*.exe" | ForEach-Object {
        $dst = "$Dest\bin\$($_.Name)"

        if (-Not (Test-Path "$dst")) {
            Write-Debug "Symlinking $_ to $dst"
            New-Item -Path "$dst" -Type SymbolicLink -Value "$_" | Out-Null
        }
    }
}

main


================================================
FILE: .ci/build-cargo-make.sh
================================================
#!/usr/bin/env sh
# shellcheck shell=sh disable=SC2039

print_usage() {
  local program="$1"

  echo "$program

    Builds cargo-make into a dedicated directory for caching

    USAGE:
        $program [FLAGS] [--] <PLUGIN>

    FLAGS:
        -h, --help      Prints help information

    ARGS:
        <PLUGIN>  Name of the Cargo plugin
    " | sed 's/^ \{1,4\}//g'
}

main() {
  set -eu
  if [ -n "${DEBUG:-}" ]; then set -v; fi
  if [ -n "${TRACE:-}" ]; then set -xv; fi

  local program
  program="$(basename "$0")"

  OPTIND=1
  while getopts "h-:" arg; do
    case "$arg" in
      h)
        print_usage "$program"
        return 0
        ;;
      -)
        case "$OPTARG" in
          help)
            print_usage "$program"
            return 0
            ;;
          '')
            # "--" terminates argument processing
            break
            ;;
          *)
            print_usage "$program" >&2
            die "invalid argument --$OPTARG"
            ;;
        esac
        ;;
      \?)
        print_usage "$program" >&2
        die "invalid argument; arg=-$OPTARG"
        ;;
    esac
  done
  shift "$((OPTIND - 1))"

  local dest
  if [ -n "${CARGO_HOME:-}" ]; then
    dest="$CARGO_HOME"
  elif [ -n "${HOME:-}" ]; then
    dest="$HOME/.cargo"
  else
    die "cannot determine CARGO_HOME"
  fi

  install_cargo_make "$dest"
}

install_cargo_make() {
  local dest="$1"
  local plugin="cargo-make"

  echo "--- Building $plugin in $dest"

  mkdir -p "$dest"
  rustup install stable
  cargo +stable install --root "$dest/opt/$plugin" --force --verbose "$plugin"

  # Create symbolic links for all execuatbles into $CARGO_HOME/bin
  ln -snf "$dest/opt/$plugin/bin"/* "$dest/bin/"
}

die() {
  echo "" >&2
  echo "xxx $1" >&2
  echo "" >&2
  return 1
}

main "$@"


================================================
FILE: .ci/build-checksums.ps1
================================================
#!/usr/bin/env powershell

<#
.SYNOPSIS
Generates checksum digests for a file

.DESCRIPTION
The script generates a SHA256 and MD5 digest, similar to that of shasum -a 256.

.EXAMPLE
.\build-checksums.ps1 file
#>

Param(
    # An input file
    [Parameter(Mandatory=$True)]
    [String[]]
    $File
)


function main([string]$File) {
    Write-Host "--- Generating checksums for '$File'"

    Build-Sha256 "$File"
    Build-Md5 "$File"
}

function Build-Sha256([string]$File) {
    Write-Host "  - Generating SHA256 checksum digest"

    Get-FileHash "$File" -Algorithm SHA256 `
        | ForEach-Object { "$($_.Hash.ToLower())  $(Split-Path $_.Path -Leaf)" } `
        > "$File.sha256"
}

function Build-Md5([string]$File) {
    Write-Host "  - Generating MD5 checksum digest"

    Get-FileHash "$File" -Algorithm MD5 `
        | ForEach-Object { "$($_.Hash.ToLower())  $(Split-Path $_.Path -Leaf)" } `
        > "$File.md5"
}

main "$File"


================================================
FILE: .ci/build-checksums.sh
================================================
#!/usr/bin/env sh
# shellcheck shell=sh disable=SC2039

print_usage() {
  local program="$1"

  echo "$program

    Generates a checksum digests for a file

    USAGE:
        $program [FLAGS] [--] <FILE>

    FLAGS:
        -h, --help      Prints help information

    ARGS:
        <FILE>  An input file
    " | sed 's/^ \{1,4\}//g'
}

main() {
  set -eu
  if [ -n "${DEBUG:-}" ]; then set -v; fi
  if [ -n "${TRACE:-}" ]; then set -xv; fi

  local program
  program="$(basename "$0")"

  OPTIND=1
  while getopts "h-:" arg; do
    case "$arg" in
      h)
        print_usage "$program"
        return 0
        ;;
      -)
        case "$OPTARG" in
          help)
            print_usage "$program"
            return 0
            ;;
          '')
            # "--" terminates argument processing
            break
            ;;
          *)
            print_usage "$program" >&2
            die "invalid argument --$OPTARG"
            ;;
        esac
        ;;
      \?)
        print_usage "$program" >&2
        die "invalid argument; arg=-$OPTARG"
        ;;
    esac
  done
  shift "$((OPTIND - 1))"

  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <FILE> argument"
  fi
  local file="$1"
  shift
  if [ ! -f "$file" ]; then
    print_usage "$program" >&2
    die "file '$file' not found"
  fi

  need_cmd basename
  need_cmd dirname

  local basename
  basename="$(basename "$file")"

  echo "--- Generating checksums for '$file'"
  cd "$(dirname "$file")"
  build_md5 "$basename"
  build_sha256 "$basename"
}

build_sha256() {
  local file="$1"

  need_cmd uname

  echo "  - Generating SHA256 checksum digest"
  {
    case "$(uname -s)" in
      FreeBSD)
        need_cmd sed
        need_cmd sha256
        sha256 "$file" | sed -E 's/^.*\(([^)]+)\) = (.+)$/\2  \1/'
        ;;
      Linux)
        need_cmd sha256sum
        sha256sum "$file"
        ;;
      Darwin)
        need_cmd shasum
        shasum -a 256 "$file"
        ;;
      *)
        die "unsupported platform '$(uname -s)'"
        ;;
    esac
  } >"$file.sha256"
}

build_md5() {
  local file="$1"

  need_cmd uname

  echo "  - Generating MD5 checksum digest"
  {
    case "$(uname -s)" in
      FreeBSD)
        need_cmd md5
        need_cmd sed
        md5 "$file" | sed -E 's/^.*\(([^)]+)\) = (.+)$/\2  \1/'
        ;;
      Linux)
        need_cmd md5sum
        md5sum "$file"
        ;;
      Darwin)
        need_cmd md5
        need_cmd sed
        md5 "$file" | sed -E 's/^.*\(([^)]+)\) = (.+)$/\2  \1/'
        ;;
      *)
        die "unsupported platform '$(uname -s)'"
        ;;
    esac
  } >"$file.md5"
}

die() {
  echo "" >&2
  echo "xxx $1" >&2
  echo "" >&2
  return 1
}

need_cmd() {
  if ! command -v "$1" >/dev/null 2>&1; then
    die "Required command '$1' not found on PATH"
  fi
}

main "$@"


================================================
FILE: .ci/build-docker-image.sh
================================================
#!/usr/bin/env sh
# shellcheck shell=sh disable=SC2039

print_usage() {
  local program="$1"

  echo "$program

    Builds a Docker image

    USAGE:
        $program [FLAGS] [--] <IMG> <VERSION> <REPO> <AUTHOR> <LICENSE> <BIN> <ARCHIVE>

    FLAGS:
        -h, --help          Prints help information

    ARGS:
        <ARCHIVE> Tarball archive [example: names-x86_64-linux-musl.tar.gz]
        <AUTHOR>  Author names [example: Jane Doe <jdoe@example.com]
        <BIN>     Name of the program [example: names]
        <IMG>     Name of Docker Hub image [example: jdoe/names]
        <LICENSE> License for project [example: MPL-2.0]
        <REPO>    Name of GitHub repository [example: jdoe/names-rs]
        <VERSION> Version to install and tag [example: 1.0.1]
    " | sed 's/^ \{1,4\}//g'
}

main() {
  set -eu
  if [ -n "${DEBUG:-}" ]; then set -v; fi
  if [ -n "${TRACE:-}" ]; then set -xv; fi

  local program img version repo author license bin archive
  program="$(basename "$0")"

  OPTIND=1
  while getopts "h-:" arg; do
    case "$arg" in
      h)
        print_usage "$program"
        return 0
        ;;
      -)
        case "$OPTARG" in
          help)
            print_usage "$program"
            return 0
            ;;
          '')
            # "--" terminates argument processing
            break
            ;;
          *)
            print_usage "$program" >&2
            die "invalid argument --$OPTARG"
            ;;
        esac
        ;;
      \?)
        print_usage "$program" >&2
        die "invalid argument; arg=$arg"
        ;;
    esac
  done
  shift "$((OPTIND - 1))"

  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <IMG> argument"
  fi
  img="$1"
  shift
  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <VERSION> argument"
  fi
  version="$1"
  shift
  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <REPO> argument"
  fi
  repo="$1"
  shift
  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <AUTHOR> argument"
  fi
  author="$1"
  shift
  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <LICENSE> argument"
  fi
  license="$1"
  shift
  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <BIN> argument"
  fi
  bin="$1"
  shift
  if [ -z "${1:-}" ]; then
    print_usage "$program" >&2
    die "missing <ARCHIVE> argument"
  fi
  archive="$1"
  shift

  if [ ! -f "$archive" ]; then
    print_usage "$program" >&2
    die "archive file does not exist: '$archive'"
  fi
  if [ ! -f "$archive.sha256" ]; then
    print_usage "$program" >&2
    die "archive checksum file does not exist: '$archive.sha256'"
  fi

  build_docker_image \
    "$img" "$version" "$repo" "$author" "$license" "$bin" "$archive"
}

build_docker_image() {
  local img="$1"
  local version="$2"
  local repo="$3"
  local author="$4"
  local license="$5"
  local bin="$6"
  local archive="$7"

  need_cmd basename
  need_cmd date
  need_cmd dirname
  need_cmd docker
  need_cmd git
  need_cmd grep
  need_cmd shasum
  need_cmd tar

  local full_name
  full_name="$(basename "$archive")"
  full_name="${full_name%%.tar.gz}"

  echo "--- Building a Docker image $img:$version for '$bin'"

  local workdir
  workdir="$(mktemp -d 2>/dev/null || mktemp -d -t tmp)"
  setup_traps "cleanup $workdir"

  local revision created
  revision="$(git show -s --format=%H)"
  created="$(date -u +%FT%TZ)"

  cd "$(dirname "$archive")"
  echo "  - Verifying $archive"
  shasum -a 256 -c "$archive.sha256"

  cd "$workdir"
  echo "  - Extracting $bin from $archive"
  tar xf "$archive"
  mv "$full_name" "$bin"

  echo "  - Generating image metadata"
  cat <<-END >image-metadata
	img="$img"
	version="$version"
	source="http://github.com/$repo.git"
	revision="$revision"
	created="$created"
	END

  echo "  - Generating Dockerfile"
  cat <<-END >Dockerfile
	FROM scratch
  LABEL \
    name="$img" \
    org.opencontainers.image.version="$version" \
    org.opencontainers.image.authors="$author" \
    org.opencontainers.image.licenses="$license" \
    org.opencontainers.image.source="http://github.com/$repo.git" \
    org.opencontainers.image.revision="$revision" \
    org.opencontainers.image.created="$created"
	ADD $bin /$bin
	ADD image-metadata /etc/image-metadata
	ENTRYPOINT ["/$bin"]
	END

  echo "  - Building image $img:$version"
  docker build -t "$img:$version" .
  if echo "$version" | grep -q -E '^\d+\.\d+.\d+$'; then
    docker tag "$img:$version" "$img:latest"
  fi
}

# See: https://git.io/JtdlJ
setup_traps() {
  local trap_fun
  trap_fun="$1"

  local sig
  for sig in HUP INT QUIT ALRM TERM; do
    trap "
      $trap_fun
      trap - $sig EXIT
      kill -s $sig "'"$$"' "$sig"
  done

  if [ -n "${ZSH_VERSION:-}" ]; then
    eval "zshexit() { eval '$trap_fun'; }"
  else
    # shellcheck disable=SC2064
    trap "$trap_fun" EXIT
  fi
}

cleanup() {
  local workdir="$1"

  if [ -d "$workdir" ]; then
    echo "  - Cleanup up Docker context $workdir"
    rm -rf "$workdir"
  fi
}

die() {
  echo "" >&2
  echo "xxx $1" >&2
  echo "" >&2
  exit 1
}

need_cmd() {
  if ! command -v "$1" >/dev/null 2>&1; then
    die "Required command '$1' not found on PATH"
  fi
}

main "$@"


================================================
FILE: .ci/cirrus-release.sh
================================================
#!/usr/bin/env sh
# shellcheck disable=SC3043

main() {
  set -eu
  if [ -n "${DEBUG:-}" ]; then set -v; fi
  if [ -n "${TRACE:-}" ]; then set -xv; fi

  local subcmd
  subcmd="$1"
  shift

  "$subcmd" "$@"
}

changelog_section() {
  local changelog_file="$1"
  local tag="$2"
  local version="${tag#v}"

  need_cmd awk

  awk -v version_header_pat="^## \\\[$version\\\] - " '
    BEGIN {
      version_section = 0
      urls_section = 0
    }

    # Start printing when the version section is found including the section
    # header
    $0 ~ version_header_pat {
      version_section = 1
      print
      next
    }
    # Stop printing when the next version section is found or when the urls
    # section is found
    version_section == 1 && (/^## \[/ || /^<!-- next-url -->$/) {
      version_section = 0
    }
    # Print lines while in the version section
    version_section == 1 {
      print
    }
    # Start printing when the urls section is found, including the section
    # comment
    /^<!-- next-url -->$/ {
      urls_section = 1
      print
      next
    }
    # Print lines while in the urls section
    urls_section == 1 {
      print
    }
  ' "$changelog_file"

}

ci_download() {
  local artifact="$1"
  shift

  need_cmd basename
  need_cmd curl

  if [ -z "${CIRRUS_BUILD_ID:-}" ]; then
    die "missing required environment variable: CIRRUS_BUILD_ID"
  fi

  local dest
  dest="$(basename "$artifact")"

  echo "--- Downlading Cirrus artifact '$artifact' to '$dest'" >&2

  curl \
    --fail \
    -X GET \
    --output "$dest" \
    "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/$artifact" \
    "${@:---}"
}

gh_create_release() {
  local repo="$1"
  local tag="$2"
  local name="$3"
  local body="$4"
  local draft="$5"
  local prerelease="$6"

  need_cmd jo
  need_cmd jq
  need_cmd sed

  local payload
  payload="$(
    jo \
      tag_name="$tag" \
      name="$name" \
      body="$body" \
      draft="$draft" \
      prerelease="$prerelease"
  )"

  local response
  if ! response="$(
    gh_rest POST "/repos/$repo/releases" --data "$payload"
  )"; then
    echo "!!! Failed to create a release for tag $tag" >&2
    return 1
  fi

  echo "$response" | jq -r .upload_url | sed -E 's,\{.+\}$,,'
}

gh_create_version_release() {
  local repo="$1"
  local tag="$2"

  gh_delete_release "$repo" "$tag"

  local prerelease
  if echo "${tag#v}" | grep -q -E '^\d+\.\d+.\d+$'; then
    prerelease=false
  else
    prerelease=true
  fi

  echo "--- Creating GitHub *draft* release '$tag' for '$repo'" >&2

  gh_create_release \
    "$repo" \
    "$tag" \
    "$tag" \
    "Release ${tag#v}" \
    true \
    "$prerelease"
}

gh_delete_release() {
  local repo="$1"
  local tag="$2"

  local release_ids rid
  release_ids="$(gh_release_id_for_tag "$repo" "$tag" 2>/dev/null)"

  if [ -n "$release_ids" ]; then
    for rid in $release_ids; do
      echo "--- Deleting GitHub pre-existing release '$tag' ($rid)" >&2
      if ! gh_rest DELETE "/repos/$repo/releases/$rid" >/dev/null; then
        echo "!!! Failed to delete a pre-existing release '$tag' ($rid)" >&2
        return 1
      fi
    done
  fi
}

gh_download() {
  local repo="$1"
  shift
  local tag="$1"
  shift
  local asset="$1"
  shift

  need_cmd curl
  need_cmd jq

  if ! gh_rest GET "/repos/$repo/releases/tags/$tag" >/tmp/response; then
    echo "!!! Failed to find a release for tag $tag" >&2
    return 1
  fi

  local dl_url
  dl_url="$(
    jq -r ".assets[] | select(.name == \"$asset\") | .browser_download_url" \
      </tmp/response
  )"

  echo "--- Downlading GitHub asset '$asset' from '$repo' ($tag)" >&2

  curl \
    --fail \
    -X GET \
    --location \
    --output "$asset" \
    "$dl_url" \
    "${@:---}"
}

gh_publish_release() {
  local repo="$1"
  local tag="$2"
  local changelog_file="$3"

  need_cmd jo
  need_cmd jq

  local release_id
  release_id="$(gh_release_id_for_tag "$repo" "$tag")"

  local body
  if [ "$tag" = "nightly" ]; then
    body=""
  else
    local changelog_section
    changelog_section="$(changelog_section "$changelog_file" "$tag")"

    body="$changelog_section"
  fi

  local payload
  payload="$(
    jo \
      draft=false \
      name="Release ${tag#v}" \
      body="$body"
  )"

  echo "--- Publishing GitHub release '$tag' for '$repo'" >&2

  local response
  if ! response="$(
    gh_rest POST "/repos/$repo/releases/$release_id" --data "$payload"
  )"; then
    echo "!!! Failed to update a release for tag $tag" >&2
    return 1
  fi
}

gh_release_id_for_tag() {
  local repo="$1"
  local tag="$2"

  need_cmd jq

  if ! gh_rest GET "/repos/$repo/releases" >/tmp/response; then
    echo "!!! Failed to find a release for tag $tag" >&2
    return 1
  fi

  jq ".[] | select(.tag_name == \"$tag\") | .id" </tmp/response
}

gh_release_upload_url_for_tag() {
  local repo="$1"
  local tag="$2"

  need_cmd jq
  need_cmd sed

  if ! gh_rest GET "/repos/$repo/releases/tags/$tag" >/tmp/response; then
    echo "!!! Failed to find a release for tag $tag" >&2
    return 1
  fi

  jq -r .upload_url </tmp/response | sed -E 's,\{.+\}$,,'
}

gh_rest() {
  local method="$1"
  shift
  local path="$1"
  shift

  gh_rest_raw "$method" "https://api.github.com$path" "$@"
}

gh_rest_raw() {
  local method="$1"
  shift
  local url="$1"
  shift

  need_cmd curl

  if [ -z "${GITHUB_TOKEN:-}" ]; then
    die "missing required environment variable: GITHUB_TOKEN"
  fi

  curl \
    --fail \
    --header "Authorization: token $GITHUB_TOKEN" \
    --header "Accept: application/vnd.github.v3+json" \
    -X "$method" \
    "$url" \
    "${@:---}"
}

gh_update_tag() {
  local repo="$1"
  local tag="$2"

  need_cmd git
  need_cmd jo

  local sha
  sha="$(git show -s --format=%H)"

  if gh_rest GET "/repos/$repo/git/refs/tags/$tag" >/dev/null 2>&1; then
    echo "--- Updating Git tag reference for '$tag'" >&2
    local payload
    payload="$(
      jo \
        sha="$sha" \
        force=true
    )"
    if ! gh_rest PATCH "/repos/$repo/git/refs/tags/$tag" --data "$payload" >/dev/null; then
      echo "!!! Failed to update Git tag reference for '$tag'" >&2
      return 1
    fi
  else
    echo "--- Creating Git tag reference for '$tag'" >&2
    local payload
    payload="$(
      jo \
        sha="$sha" \
        ref="refs/tags/$tag"
    )"
    if ! gh_rest POST "/repos/$repo/git/refs" --data "$payload" >/dev/null; then
      echo "!!! Failed to create Git tag reference for '$tag'" >&2
      return 1
    fi
  fi
}

gh_upload() {
  local url="$1"
  local artifact_file="$2"

  need_cmd basename

  if [ ! -f "$artifact_file" ]; then
    echo "!!! Artifact file '$artifact_file' not found, cannot upload" >&2
    return 1
  fi

  local artifact content_type
  artifact="$(basename "$artifact_file")"
  content_type="application/octet-stream"

  echo "--- Publishing artifact '$artifact' to $url" >&2

  gh_rest_raw POST "$url?name=$artifact" \
    --header "Content-Type: $content_type" \
    --data-binary "@$artifact_file"
}

gh_upload_all() {
  local url="$1"
  local dir="$2"

  find "$dir" -type f | while read -r artifact_file; do
    if ! gh_upload "$url" "$artifact_file"; then
      echo "!!! Failed to upload '$artifact_file'" >&2
      return 1
    fi
  done
}

die() {
  echo "" >&2
  echo "xxx $1" >&2
  echo "" >&2
  exit 1
}

need_cmd() {
  if ! command -v "$1" >/dev/null 2>&1; then
    die "Required command '$1' not found on PATH"
  fi
}

main "$@"


================================================
FILE: .ci/install-cargo-make.ps1
================================================
#!/usr/bin/env powershell

<#
.SYNOPSIS
Installs cargo-make

.DESCRIPTION
The script will download and extract a version of `cargo-make` into
a destination path

.EXAMPLE
.\install-cargo-make.ps1
#>

param (
    # The version to install which overrides the default of latest
    [string]$Version = "",
    # Prints the latest version of cargo-make
    [switch]$PrintLatest = $false
)

function main() {
    if (Test-Path env:CARGO_HOME) {
        $dest = "$env:CARGO_HOME\bin"
    } elseif (Test-Path env:USERPROFILE) {
        $dest = "$env:USERPROFILE\.cargo\bin"
    } elseif (Test-Path env:HOME) {
        $dest = "$env:HOME\.cargo\bin"
    } else {
        throw "cannot determine CARGO_HOME"
    }

    if ($Version.Length -gt 0) {
        $version = "$Version"
    } else {
        $version = Get-LatestCargoMakeVersion
    }

    if ($PrintLatest) {
        Write-Host "$version"
    } else {
        Install-CargoMake "$version" "$dest"
    }
}

function Get-LatestCargoMakeVersion() {
    $crate = "cargo-make"

    (cargo search --limit 1 --quiet "$crate" | Select-Object -First 1).
        Split('"')[1]
}

function Install-CargoMake([string]$Version, [string]$Dest) {
    $fileBase = "cargo-make-v$Version-x86_64-pc-windows-msvc"
    $url = "https://github.com/sagiegurari/cargo-make/releases/download/$Version"
    $url = "$url/$fileBase.zip"

    Write-Output "--- Installing cargo-make $Version to $Dest"

    $archive = New-TemporaryFile
    Rename-Item "$archive" "$archive.zip"
    $archive = "$archive.zip"
    $tmpdir = New-TemporaryDirectory

    if (-Not (Test-Path "$Dest")) {
        New-Item -Type Directory "$Dest" | Out-Null
    }

    try {
        Write-Output "  - Downloading $url to $archive"
        (New-Object System.Net.WebClient).DownloadFile($url, $archive)
        Expand-Archive -LiteralPath "$archive" -DestinationPath "$tmpdir"
        Write-Output "  - Extracting cargo-make.exe to $Dest"
        Copy-Item "$tmpdir\cargo-make.exe" -Destination "$Dest"
    } finally {
        Remove-Item "$archive" -Force
        Remove-Item "$tmpdir" -Force -Recurse
    }
}

function New-TemporaryDirectory {
    $parent = [System.IO.Path]::GetTempPath()
    [string]$name = [System.Guid]::NewGuid()
    New-Item -ItemType Directory -Path (Join-Path $parent $name)
}

main


================================================
FILE: .ci/install-cargo-make.sh
================================================
#!/usr/bin/env sh
# shellcheck shell=sh disable=SC2039

print_usage() {
  local program="$1"

  echo "$program

    Installs cargo-make

    USAGE:
        $program [FLAGS] [--] [<VERSION>]

    FLAGS:
        -h, --help          Prints help information
            --print-latest  Prints the latest version of cargo-make

    ARGS:
        <VERSION>  Version to install which overrides the default of latest
    " | sed 's/^ \{1,4\}//g'
}

main() {
  set -eu
  if [ -n "${DEBUG:-}" ]; then set -v; fi
  if [ -n "${TRACE:-}" ]; then set -xv; fi

  local program version print_latest
  program="$(basename "$0")"
  version=""
  print_latest=""

  OPTIND=1
  while getopts "h-:" arg; do
    case "$arg" in
      h)
        print_usage "$program"
        return 0
        ;;
      -)
        case "$OPTARG" in
          help)
            print_usage "$program"
            return 0
            ;;
          print-latest)
            print_latest=true
            ;;
          '')
            # "--" terminates argument processing
            break
            ;;
          *)
            print_usage "$program" >&2
            die "invalid argument --$OPTARG"
            ;;
        esac
        ;;
      \?)
        print_usage "$program" >&2
        die "invalid argument; arg=$arg"
        ;;
    esac
  done
  shift "$((OPTIND - 1))"

  local dest
  if [ -n "${CARGO_HOME:-}" ]; then
    dest="$CARGO_HOME/bin"
  elif [ -n "${HOME:-}" ]; then
    dest="$HOME/.cargo/bin"
  else
    die "cannot determine CARGO_HOME"
  fi

  if [ -n "${1:-}" ]; then
    version="$1"
    shift
  else
    version="$(latest_cargo_make_version)"
  fi

  if [ -n "$print_latest" ]; then
    echo "$version"
  else
    install_cargo_make "$version" "$dest"
  fi
}

latest_cargo_make_version() {
  local crate="cargo-make"

  cargo search --limit 1 --quiet "$crate" | head -n 1 | awk -F'"' '{print $2}'
}

install_cargo_make() {
  local version dest platform target file_base url archive
  version="$1"
  dest="$2"

  echo "--- Installing cargo-make $version to $dest"

  platform="$(uname -s)"
  case "$platform" in
    Darwin) target="x86_64-apple-darwin" ;;
    Linux) target="x86_64-unknown-linux-musl" ;;
    *) die "Platform '$platform' is not supported" ;;
  esac
  archive="$(mktemp 2>/dev/null || mktemp -t tmp)"
  file_base="cargo-make-v${version}-${target}"
  url="https://github.com/sagiegurari/cargo-make/releases/download/$version"
  url="$url/$file_base.zip"

  mkdir -p "$dest"
  echo "  - Downloading $url to $archive"
  curl -sSfL "$url" -o "$archive"
  echo "  - Extracting cargo-make into $dest"
  unzip -jo "$archive" "$file_base/cargo-make" -d "$dest"
  rm -f "$archive"
}

die() {
  echo "" >&2
  echo "xxx $1" >&2
  echo "" >&2
  exit 1
}

main "$@"


================================================
FILE: .ci/names.manifest.txt
================================================
darwin-x86_64	names-x86_64-apple-darwin.zip
freebsd-x86_64	names-x86_64-unknown-freebsd.tar.gz
linux-aarch64	names-aarch64-unknown-linux-gnu.tar.gz
linux-arm	names-arm-unknown-linux-gnueabihf.tar.gz
linux-i686	names-i686-unknown-linux-musl.tar.gz
linux-x86_64	names-x86_64-unknown-linux-musl.tar.gz
linuxgnu-i686	names-i686-unknown-linux-gnu.tar.gz
linuxgnu-x86_64	names-x86_64-unknown-linux-gnu.tar.gz
windows-x86_64	names-x86_64-pc-windows-msvc.zip


================================================
FILE: .cirrus.yml
================================================
---
# BEGIN: cirrus-anchors.yml
anchors:
  - &install_cargo_make_unix
    install_cargo_make_script: ./.ci/install-cargo-make.sh

  - &install_cargo_make_windows
    install_cargo_make_script: .\.ci\install-cargo-make.ps1

  - &build_cargo_make_unix
    build_cargo_make_cache:
      folder: $CARGO_HOME/opt/cargo-make
      fingerprint_script: |
        echo "$CIRRUS_OS"
        echo "${CI_CACHE_BUST:-}"
        echo "$RUST_VERSION"
        ./.ci/install-cargo-make.sh --print-latest
      populate_script: ./.ci/build-cargo-make.sh
    link_cargo_make_script: ln -snf "$CARGO_HOME"/opt/*/bin/* "$CARGO_HOME"/bin/

  - &build_cargo_make_windows
    build_cargo_make_cache:
      folder: $CARGO_HOME\opt\cargo-make
      fingerprint_script: |
        $env:CIRRUS_OS
        $env:CI_CACHE_BUST
        $env:RUST_VERSION
        .\.ci\install-cargo-make.ps1 -PrintLatest
      populate_script: .\.ci\build-cargo-make.ps1
    link_cargo_make_script: |
      Get-ChildItem "$env:CARGO_HOME\opt\*\bin\*.exe" | ForEach-Object {
        $dst = "$env:CARGO_HOME\bin\$($_.Name)"

        if (-Not (Test-Path "$dst")) {
          New-Item -Path "$dst" -Type SymbolicLink -Value "$_" | Out-Null
        }
      }

  - &base_unix
    env:
      CARGO_HOME: /usr/local/cargo
      PATH: /usr/local/cargo/bin:$PATH
    install_rustup_script: |
      curl -sSfL https://sh.rustup.rs | sh -s -- \
        -y --default-toolchain none --profile minimal --no-modify-path
    install_rust_script: rustup default "$RUST_VERSION"
    registry_cache:
      folder: $CARGO_HOME/registry
      fingerprint_script: |
        if [ ! -f Cargo.lock ]; then
          cargo generate-lockfile --quiet
        fi
        echo "${CI_CACHE_BUST:-}"
        echo "${CIRRUS_OS}"
        cat Cargo.lock
    target_cache:
      folder: target
      fingerprint_script: |
        if [ ! -f Cargo.lock ]; then
          cargo generate-lockfile --quiet
        fi
        echo "${CI_CACHE_BUST:-}"
        echo "$CIRRUS_TASK_NAME"
        rustc --verbose --version
        cat Cargo.lock

  - &base_linux
    install_dependencies_script: |
      if command -v yum >/dev/null; then
        yum install -y unzip
      else
        apt-get install -y unzip
      fi
    <<: *base_unix
    <<: *install_cargo_make_unix

  - &base_macos
    <<: *base_unix
    env:
      CARGO_HOME: $HOME/.cargo
      PATH: $HOME/.cargo/bin:$PATH
    <<: *install_cargo_make_unix

  - &base_freebsd
    <<: *base_unix
    <<: *build_cargo_make_unix

  - &base_windows
    env:
      CIRRUS_SHELL: powershell
      CARGO_HOME: $USERPROFILE\.cargo
      PATH: $USERPROFILE\.cargo\bin;$PATH

    install_rustup_script: |
      & ([scriptblock]::Create((New-Object System.Net.WebClient).
        DownloadString('https://gist.github.com/fnichol/699d3c2930649a9932f71bab8a315b31/raw/rustup-init.ps1')
        )) -y --default-toolchain none --profile minimal
    install_rust_script: rustup default "$env:RUST_VERSION"
    registry_cache:
      folder: $CARGO_HOME\registry
      fingerprint_script: |
        if (-Not (Test-Path "Cargo.lock")) {
          cargo "+$env:RUST_VERSION" generate-lockfile --quiet
        }
        $env:CI_CACHE_BUST
        $env:CIRRUS_OS
        Get-Content Cargo.lock
    target_cache:
      folder: target
      fingerprint_script: |
        if (-Not (Test-Path "Cargo.lock")) {
          cargo "+$env:RUST_VERSION" generate-lockfile --quiet
        }
        $env:CI_CACHE_BUST
        $env:CIRRUS_TASK_NAME
        rustc --verbose --version
        Get-Content Cargo.lock
    <<: *install_cargo_make_windows

  - &install_target_unix
    install_rustup_target_script: rustup target install "$TARGET"

  - &install_target_windows
    install_rustup_target_script: rustup target install "$env:TARGET"

  - &build_bin_unix
    build_script: |
      if [ "${CIRRUS_TAG:-}" = "nightly" ]; then
        export NIGHTLY_BUILD="$(date -u +%F)"
      fi
      cargo make build-release "--bin=$BIN" "--target=$TARGET"
    strip_script: $STRIP "target/$TARGET/release/$BIN"
    rename_script: cp "target/$TARGET/release/$BIN" "${BIN}-${TARGET}"

  - &build_lib_unix
    build_script: |
      args=""
      if [ -n "${FEATURES:-}" ]; then
        args="--features $FEATURES"
      fi
      if [ -n "${NO_DEFAULT_FEATURES:-}" ]; then
        args="$args --no-default-features"
      fi
      if [ -n "${ALL_FEATURES:-}" ]; then
        args="$args --all-features"
      fi
      cargo make build-release "--lib=$LIB" "--target=$TARGET" $args

  - &build_bin_windows
    build_script: |
      if ("$env:CIRRUS_TAG" -eq "nightly") {
        $env:NIGHTLY_BUILD = $(Get-Date ([datetime]::UtcNow) -UFormat %Y-%m-%d)
      }
      cargo make build-release "--bin=$env:BIN" "--target=$env:TARGET"
    rename_script: |
      Copy-Item "target\$env:TARGET\release\$env:BIN.exe" "$env:BIN-$env:TARGET.exe"

  - &build_lib_windows
    build_script: |
      $args = ""
      if ("$env:FEATURES") {
        $args = "--features $env:FEATURES"
      }
      if ("$env:NO_DEFAULT_FEATURES") {
        $args = "$args --no-default-features"
      }
      if ("$env:ALL_FEATURES") {
        $args = "$args --all-features"
      }
      cargo make build-release "--bin=$env:BIN" "--target=$env:TARGET" $args

  - &cleanup_before_upload_cache_unix
    cleanup_before_upload_cache_script: rm -rf "$CARGO_HOME/registry/index"

  - &cleanup_before_upload_cache_windows
    cleanup_before_upload_cache_script: |
      if (Test-Path "$env:USERPROFILE\.cargo\registry\index") {
        Remove-Item -Recurse -Force "$env:USERPROFILE\.cargo\registry\index"
      }
# END: cirrus-anchors.yml
#
#
env:
  RUST_VERSION: stable
  MIN_SUPPORTED_RUST_VERSION: 1.54.0 # Due to clap v3

check_task:
  name: check
  only_if:
    $CIRRUS_BRANCH !=~ ".*\.tmp" && $CIRRUS_BRANCH != $CIRRUS_DEFAULT_BRANCH
  container:
    image: rust:latest
  <<: *base_linux
  lint_script: cargo make check-lint
  format_script: cargo make check-format

test_task:
  name: test-${RUST_VERSION}-${TARGET}
  alias: tests
  only_if:
    $CIRRUS_BRANCH !=~ ".*\.tmp" && $CIRRUS_BRANCH != $CIRRUS_DEFAULT_BRANCH
  env:
    matrix:
      - RUST_VERSION: stable
      - RUST_VERSION: nightly
      - RUST_VERSION: $MIN_SUPPORTED_RUST_VERSION
  allow_failures: $RUST_VERSION == 'nightly'
  matrix:
    - matrix:
        - env:
            TARGET: x86_64-unknown-linux-gnu
          container:
            image: rust:latest
          <<: *base_linux
        - env:
            TARGET: x86_64-apple-darwin
          osx_instance:
            image: catalina-base
          <<: *base_macos
        - env:
            TARGET: x86_64-unknown-freebsd
          freebsd_instance:
            image_family: freebsd-12-2
          <<: *base_freebsd
      <<: *install_target_unix
      test_bin_script: cargo make test-bin "--target=$TARGET"
      test_lib_script: cargo make test-lib "--target=$TARGET"
      <<: *cleanup_before_upload_cache_unix
    - env:
        TARGET: x86_64-pc-windows-msvc
      windows_container:
        image: fnichol/windowsservercore:ltsc2019-vs2019-vctools
      <<: *base_windows
      <<: *install_target_windows
      test_bin_script: cargo make test-bin "--target=$env:TARGET"
      test_lib_script: cargo make test-lib "--target=$env:TARGET"
      <<: *cleanup_before_upload_cache_windows

build_bin_task:
  name: build-bin-${BIN}-${TARGET}.${EXT}
  alias: build-bins
  only_if:
    $CIRRUS_TAG != '' || $CIRRUS_BRANCH == 'staging' || $CIRRUS_BRANCH ==
    'trying'
  env:
    BIN: names
    RUST_BACKTRACE: "1"
  matrix:
    - matrix:
        - env:
            matrix:
              - TARGET: arm-unknown-linux-gnueabihf
                STRIP: arm-linux-gnueabihf-strip
              - TARGET: aarch64-unknown-linux-gnu
                STRIP: aarch64-linux-gnu-strip
              - TARGET: i686-unknown-linux-gnu
                STRIP: x86_64-linux-gnu-strip
              - TARGET: i686-unknown-linux-musl
                STRIP: i686-linux-musl-strip
              - TARGET: x86_64-unknown-linux-gnu
                STRIP: strip
              - TARGET: x86_64-unknown-linux-musl
                STRIP: x86_64-linux-musl-strip
            EXT: tar.gz
          container:
            image: rustembedded/cross:$TARGET
          depends_on:
            - check
            - test-stable-x86_64-unknown-linux-gnu
          <<: *base_linux
          <<: *install_target_unix
          <<: *build_bin_unix
          archive_script: tar czf "$BIN-$TARGET.$EXT" "$BIN-$TARGET"
        - env:
            TARGET: x86_64-apple-darwin
            STRIP: strip
            EXT: zip
          osx_instance:
            image: catalina-base
          depends_on:
            - check
            - test-stable-x86_64-apple-darwin
          <<: *base_macos
          <<: *install_target_unix
          <<: *build_bin_unix
          archive_script: zip "$BIN-$TARGET" "$BIN-$TARGET"
        - env:
            TARGET: x86_64-unknown-freebsd
            STRIP: strip
            EXT: tar.gz
          freebsd_instance:
            image_family: freebsd-12-2
          depends_on:
            - check
            - test-stable-x86_64-unknown-freebsd
          <<: *base_freebsd
          <<: *install_target_unix
          <<: *build_bin_unix
          archive_script: tar czf "$BIN-$TARGET.$EXT" "$BIN-$TARGET"
      checksums_script: ./.ci/build-checksums.sh "$BIN-$TARGET.$EXT"
      binaries_artifacts:
        path: "$BIN-$TARGET.$EXT*"
      <<: *cleanup_before_upload_cache_unix
    - env:
        TARGET: x86_64-pc-windows-msvc
        EXT: zip
      windows_container:
        image: fnichol/windowsservercore:ltsc2019-vs2019-vctools
      depends_on:
        - check
        - test-stable-x86_64-pc-windows-msvc
      <<: *base_windows
      <<: *install_target_windows
      <<: *build_bin_windows
      archive_script: |
        Compress-Archive "$env:BIN-$env:TARGET.exe" "$env:BIN-$env:TARGET.$env:EXT"
      checksums_script:
        .\.ci\build-checksums.ps1 "$env:BIN-$env:TARGET.$env:EXT"
      binaries_artifacts:
        path: "$BIN-$TARGET.$EXT*"
      <<: *cleanup_before_upload_cache_windows

ci_finished_task:
  name: ci-finished
  depends_on:
    - check
    - tests
    - build-bins
  container:
    image: alpine:3
  clone_script: mkdir -p "$CIRRUS_WORKING_DIR"
  success_script: /bin/true

create_github_release_task:
  name: create-github-release
  only_if: $CIRRUS_TAG != ''
  depends_on:
    - build-bins
  container:
    image: alpine:3
  env:
    BIN: names
    GITHUB_TOKEN: ENCRYPTED[9be96903fa85656e590b3336e1a7d1f9c05ad5b1f1881acd47038451fc554f28568fc9a539617180cbd01d08d16f8d73]
  install_dependencies_script: apk add curl git jo jq
  create_github_release_script: |
    if ! upload_url="$(
      ./.ci/cirrus-release.sh gh_create_version_release \
        "$CIRRUS_REPO_FULL_NAME" \
        "$CIRRUS_TAG"
    )"; then
      echo "xxx Failed to create release" >&2
      exit 1
    fi
    echo "$upload_url" > /tmp/upload_url
  download_cirrus_artifacts_script: |
    cr="$(readlink -f ./.ci/cirrus-release.sh)"
    manifest="$(readlink -f ".ci/$BIN.manifest.txt")"
    mkdir -p /tmp/release
    cd /tmp/release
    awk '{ print $2 }' "$manifest" | while read -r a; do
      "$cr" ci_download "build-bin-$a/binaries/$a"
      "$cr" ci_download "build-bin-$a/binaries/$a.md5"
      "$cr" ci_download "build-bin-$a/binaries/$a.sha256"
    done
    cp "$manifest" .
    ls -l "$BIN"*
  upload_github_release_artifacts_script: |
    url="$(cat /tmp/upload_url)"
    ./.ci/cirrus-release.sh gh_upload_all "$url" /tmp/release

build_docker_image_docker_builder:
  name: build-docker-image-${BIN}
  alias: build-docker-images
  only_if: $CIRRUS_TAG != ''
  depends_on:
    - build-bins
    - create-github-release
  env:
    AUTHOR: Fletcher Nichol <fnichol@nichol.ca>
    LICENSE: MIT
    BIN: names
    REPO: fnichol/$BIN
    IMG: $REPO
    TARGET: x86_64-unknown-linux-musl
    EXT: tar.gz
    ARCHIVE: $BIN-$TARGET.$EXT
    DOCKER_USERNAME: ENCRYPTED[8a1752e5e975bfdb57a81e88dac08c6a31f909acd6a82e213b4d362a57f8b090767641662bab840d76ef26de38588451]
    DOCKER_PASSWORD: ENCRYPTED[12bfff137d45a5dfb76671cbd072338ef04c54cf0f6b7076eccb8eaee28812e412c1eaacb612312a535b7b255ab18a93]
  download_cirrus_artifacts_script: |
    cr="$(readlink -f ./.ci/cirrus-release.sh)"
    mkdir -p /tmp/artifacts
    cd /tmp/artifacts
    "$cr" ci_download "build-bin-$ARCHIVE/binaries/$ARCHIVE"
    "$cr" ci_download "build-bin-$ARCHIVE/binaries/$ARCHIVE.sha256"
  build_script: |
    ./.ci/build-docker-image.sh \
      "$IMG" "${CIRRUS_TAG#v}" "$REPO" "$AUTHOR" "$LICENSE" "$BIN" \
      "/tmp/artifacts/$ARCHIVE"
  login_script: |
    echo "$DOCKER_PASSWORD" \
      | docker login --username "$DOCKER_USERNAME" --password-stdin
  push_script: |
    docker push "$IMG:${CIRRUS_TAG#v}"
    if echo "${CIRRUS_TAG#v}" | grep -q -E '^\d+\.\d+.\d+$'; then
      docker push "$IMG:latest"
    fi

publish_crate_task:
  name: publish-crate-${CRATE}
  alias: publish-crates
  only_if: $CIRRUS_TAG =~ 'v.*'
  depends_on:
    - create-github-release
    - build-docker-images
  env:
    CRATE: names
    CRATES_IO_TOKEN: ENCRYPTED[c3770979566d3fd0c7ba135250e2404db106867855055972b40c3ea37762a0ddc2115c03b1e97ad0de7ed9f99c2f0097]
  container:
    image: rust:latest
  <<: *base_linux
  login_script: echo "$CRATES_IO_TOKEN" | cargo login
  publish_script: cargo publish

publish_github_release_task:
  name: publish-github-release
  only_if: $CIRRUS_TAG != ''
  depends_on:
    - create-github-release
    - build-docker-images
    - publish-crates
  container:
    image: alpine:3
  env:
    GITHUB_TOKEN: ENCRYPTED[9be96903fa85656e590b3336e1a7d1f9c05ad5b1f1881acd47038451fc554f28568fc9a539617180cbd01d08d16f8d73]
  install_dependencies_script: apk add curl jo jq
  publish_release_script: |
    ./.ci/cirrus-release.sh gh_publish_release \
      "$CIRRUS_REPO_FULL_NAME" "$CIRRUS_TAG" CHANGELOG.md

release_finished_task:
  name: release-finished
  only_if: $CIRRUS_TAG != ''
  depends_on:
    - create-github-release
    - build-docker-images
    - publish-crates
    - publish-github-release
  container:
    image: alpine:3
  clone_script: mkdir -p "$CIRRUS_WORKING_DIR"
  success_script: /bin/true

trigger_nightly_release_task:
  name: trigger-nightly-release
  only_if: $CIRRUS_CRON == 'nightly'
  container:
    image: alpine:3
  env:
    GITHUB_TOKEN: ENCRYPTED[9be96903fa85656e590b3336e1a7d1f9c05ad5b1f1881acd47038451fc554f28568fc9a539617180cbd01d08d16f8d73]
  install_dependencies_script: apk add curl git jo jq
  trigger_release_script:
    ./.ci/cirrus-release.sh gh_update_tag "$CIRRUS_REPO_FULL_NAME" nightly


================================================
FILE: .gitattributes
================================================
.ci/** linguist-vendored
.github/** linguist-vendored


================================================
FILE: .github/bors.toml
================================================
status = ["ci-finished"]
commit_title = "merge: ${PR_REFS}"


================================================
FILE: .gitignore
================================================
target/


================================================
FILE: .prettierrc.yml
================================================
proseWrap: always


================================================
FILE: CHANGELOG.md
================================================
# Changelog

<!-- next-header -->

## [Unreleased] - ReleaseDate

## [0.14.0] - 2022-06-28

### Changed

- upgrade to `regex` 1.5.6

## [0.13.0] - 2022-03-05

### Changed

- upgrade to `clap` version 3
- update other dependencies via `cargo update`

## [0.12.0] - 2021-09-12

> **Breaking Change Upgrade Note For Library Users**
>
> Due to the collapsing of a library crate and a binary/CLI crate into one
> crate, there is now a Cargo feature called `"application"` which is included
> in the default features. This allows for a clean `cargo install names`,
> resulting in a compilation and installation of the names CLI without any
> further options or flags. When using names as a library crate however, it is
> advised to now add `default-features = false` to the crate dependency in
> `Cargo.toml`. For example:
>
> ```toml
> [dependencies]
> names = { version = "0.12.0", default-features = false }
> ```
>
> This will exclude the `clap` crate when being used in library/crate mode.

### Changed

- **(breaking):** collapse library and binary into 1 dual-purpose crate which
  enables `cargo install names` to install the binary CLI
- **(breaking):** upgrade minimum supported Rust version to 1.46.0
- upgrade to `rand` 0.8.4
- upgrade to `clap` 3.0.0-beta.2
- update codebase to Rust 2018 edition and idioms

### Added

- cross platform matrix testing
- binary artifacts on each release for Linux, macOS, Windows, & FreeBSD systems
- nightly releases

## [0.11.0] - 2016-04-29

### Changed

- **(breaking):** move adjectives const to `names::ADJECTIVES`
- **(breaking):** move nouns const to `names::NOUNS`
- inline adjective and noun data from plaintext files

### Added

- (cli): add color and suggestions features

## [0.10.0] - 2015-11-01

### Changed

- **(breaking):** use `Default` trait for Generator & Name types
- (cli): update usage output

## [0.9.0] - 2015-09-15

The initial release.

<!-- next-url -->

[unreleased]: https://github.com/fnichol/names/compare/v0.14.0...HEAD

[0.14.0]: https://github.com/fnichol/names/compare/v0.13.0...v0.14.0

[0.13.0]: https://github.com/fnichol/names/compare/v0.12.0...v0.13.0

[0.12.0]: https://github.com/fnichol/names/compare/v0.11.0...v0.12.0

[0.11.0]: https://github.com/fnichol/names/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/fnichol/names/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/fnichol/names/compare/f852f53...v0.9.0


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
  advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at fnichol@nichol.ca. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq



================================================
FILE: Cargo.toml
================================================
[package]
name = "names"
version = "0.14.1-dev"
authors = ["Fletcher Nichol <fnichol@nichol.ca>"]
edition = "2018"
license = "MIT"
readme = "README.md"
repository = "https://github.com/fnichol/names"
documentation = "https://docs.rs/names"
homepage = "https://github.com/fnichol/names"
keywords = ["name", "random"]
categories = ["command-line-utilities"]
description = """
A random name generator with names suitable for use in container
instances, project names, application instances, etc.
"""

[features]
default = ["application"]

# Required for building the `names` CLI. Should be disabled when depending on
# names as a library. For example, to use as a library in a Cargo.toml:
# `names = { version = "...", default-features = false }`
application = ["clap"]

[dependencies]
clap = { version = "3.1.5", optional = true, features = ["derive"] }
rand = "0.8.4"

[dev-dependencies]
version-sync = "0.9.1"

[package.metadata.docs.rs]
no-default-features = true


================================================
FILE: LICENSE.txt
================================================
Copyright (c) 2015 Fletcher Nichol

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


================================================
FILE: Makefile.toml
================================================
extend = "./vendor/cargo-make/Makefile.common.toml"

[tasks.install-sh-upgrade-libsh]
description = "Upgrades the inserted version of libsh in install.sh"
script = '''
	curl --proto '=https' --tlsv1.2 -sSf \
		https://fnichol.github.io/libsh/install.sh \
		| sh -s -- --mode=insert --target=install.sh --distribution=full-minified
'''


================================================
FILE: README.md
================================================
<h1 align="center">
  <br/>
  names
  <br/>
</h1>

<h4 align="center">
  Random name generator for Rust
</h4>

|                  |                                                                                          |
| ---------------: | ---------------------------------------------------------------------------------------- |
|               CI | [![CI Status][badge-ci-overall]][ci]<br /> [![Bors enabled][badge-bors]][bors-dashboard] |
|   Latest Version | [![Latest version][badge-version]][crate]                                                |
|    Documentation | [![Documentation][badge-docs]][docs]                                                     |
|  Crate Downloads | [![Crate downloads][badge-crate-dl]][crate]                                              |
| GitHub Downloads | [![Github downloads][badge-github-dl]][github-releases]                                  |
|     Docker Pulls | [![Docker pulls][badge-docker-pulls]][docker]                                            |
|          License | [![Crate license][badge-license]][github]                                                |

<details>
<summary><strong>Table of Contents</strong></summary>

<!-- toc -->

- [CLI](#cli)
  - [Usage](#usage)
  - [Installation](#installation)
    - [install.sh (Pre-Built Binaries)](#installsh-pre-built-binaries)
    - [GitHub Releasees (Pre-Built Binaries)](#github-releasees-pre-built-binaries)
    - [Docker Image](#docker-image)
    - [Cargo Install](#cargo-install)
    - [From Source](#from-source)
- [Library](#library)
  - [Usage](#usage-1)
  - [Examples](#examples)
    - [Example: painless defaults](#example-painless-defaults)
    - [Example: with custom dictionaries](#example-with-custom-dictionaries)
- [CI Status](#ci-status)
  - [Build (main branch)](#build-main-branch)
  - [Test (main branch)](#test-main-branch)
  - [Check (main branch)](#check-main-branch)
- [Code of Conduct](#code-of-conduct)
- [Issues](#issues)
- [Contributing](#contributing)
- [Release History](#release-history)
- [Authors](#authors)
- [License](#license)

<!-- tocstop -->

</details>

## CLI

### Usage

Simple! Run without any parameters, you get a name:

```console
> names
selfish-change
```

Need more? Tell it how many:

```console
> names 10
rustic-flag
nondescript-crayon
picayune-map
elderly-cough
skinny-jeans
neat-rock
aware-sponge
psychotic-coast
brawny-event
tender-oatmeal
```

Not random enough? How about adding a 4-number pad:

```console
> names --number 5
imported-rod-9680
thin-position-2344
hysterical-women-5647
volatile-pen-9210
diligent-grip-4520
```

If you're ever confused, at least there's help:

```console
> names --help
names 0.11.0
Fletcher Nichol <fnichol@nichol.ca>

A random name generator with results like "delirious-pail"

USAGE:
    names [FLAGS] [AMOUNT]

ARGS:
    <AMOUNT>    Number of names to generate [default: 1]

FLAGS:
    -h, --help       Prints help information
    -n, --number     Adds a random number to the name(s)
    -V, --version    Prints version information
```

### Installation

#### install.sh (Pre-Built Binaries)

An installer is provided at <https://fnichol.github.io/names/install.sh> which
installs a suitable pre-built binary for common systems such as Linux, macOS,
Windows, and FreeBSD. It can be downloaded and run locally or piped into a shell
interpreter in the "curl-bash" style as shown below. Note that if you're opposed
to this idea, feel free to check some of the alternatives below.

To install the latest release for your system into `$HOME/bin`:

```sh
curl -sSf https://fnichol.github.io/names/install.sh | sh
```

When the installer is run as `root` the installation directory defaults to
`/usr/local/bin`:

```sh
curl -sSf https://fnichol.github.io/names/install.sh | sudo sh
```

A [nightly] release built from `HEAD` of the main branch is available which can
also be installed:

```sh
curl -sSf https://fnichol.github.io/names/install.sh \
    | sh -s -- --release=nightly
```

For a full set of options, check out the help usage with:

```sh
curl -sSf https://fnichol.github.io/names/install.sh | sh -s -- --help
```

#### GitHub Releasees (Pre-Built Binaries)

Each release comes with binary artifacts published in [GitHub
Releases][github-releases]. The `install.sh` program downloads its artifacts
from this location so this serves as a manual alternative. Each artifact ships
with MD5 and SHA256 checksums to help verify the artifact on a target system.

#### Docker Image

A minimal image ships with each release (including a [nightly] built version
from `HEAD` of the main branch) published to [Docker Hub][docker]. The
entrypoint invokes the binary directly, so any arguments to `docker run` will be
passed to the program. For example, to display the full help usage:

```sh
docker run fnichol/names --help
```

#### Cargo Install

If [Rust](https://rustup.rs/) is installed on your system, then installing with
Cargo is straight forward with:

```sh
cargo install names
```

#### From Source

To install from source, you can clone the Git repository, build with Cargo and
copy the binary into a destination directory. This will build the project from
the latest commit on the main branch, which may not correspond to the latest
stable release:

```console
> git clone https://github.com/fnichol/names.git
> cd names
> cargo build --release
> cp ./target/release/names /dest/path/
```

---

## Library

This crate provides a generate that constructs random name strings suitable for
use in container instances, project names, application instances, etc.

The name `Generator` implements the `Iterator` trait so it can be used with
adapters, consumers, and in loops.

### Usage

This crate is [on crates.io](https://crates.io/crates/names) and can be used by
adding `names` to your dependencies in your project's `Cargo.toml` file:

```toml
[dependencies]
names = { version = "0.14.0", default-features = false }
```

### Examples

#### Example: painless defaults

The easiest way to get started is to use the default `Generator` to return a
name:

```rust
use names::Generator;

let mut generator = Generator::default();
println!("Your project is: {}", generator.next().unwrap());
// #=> "Your project is: rusty-nail"
```

If more randomness is required, you can generate a name with a trailing 4-digit
number:

```rust
use names::{Generator, Name};

let mut generator = Generator::with_naming(Name::Numbered);
println!("Your project is: {}", generator.next().unwrap());
// #=> "Your project is: pushy-pencil-5602"
```

#### Example: with custom dictionaries

If you would rather supply your own custom adjective and noun word lists, you
can provide your own by supplying 2 string slices. For example, this returns
only one result:

```rust
use names::{Generator, Name};

let adjectives = &["imaginary"];
let nouns = &["roll"];
let mut generator = Generator::new(adjectives, nouns, Name::default());

assert_eq!("imaginary-roll", generator.next().unwrap());
```

## CI Status

### Build (main branch)

| Operating System | Target                        | Stable Rust                                                                     |
| ---------------: | ----------------------------- | ------------------------------------------------------------------------------- |
|          FreeBSD | `x86_64-unknown-freebsd`      | [![FreeBSD Build Status][badge-ci-build-x86_64-unknown-freebsd]][ci-staging]    |
|            Linux | `arm-unknown-linux-gnueabihf` | [![Linux Build Status][badge-ci-build-arm-unknown-linux-gnueabihf]][ci-staging] |
|            Linux | `aarch64-unknown-linux-gnu`   | [![Linux Build Status][badge-ci-build-aarch64-unknown-linux-gnu]][ci-staging]   |
|            Linux | `i686-unknown-linux-gnu`      | [![Linux Build Status][badge-ci-build-i686-unknown-linux-gnu]][ci-staging]      |
|            Linux | `i686-unknown-linux-musl`     | [![Linux Build Status][badge-ci-build-i686-unknown-linux-musl]][ci-staging]     |
|            Linux | `x86_64-unknown-linux-gnu`    | [![Linux Build Status][badge-ci-build-x86_64-unknown-linux-gnu]][ci-staging]    |
|            Linux | `x86_64-unknown-linux-musl`   | [![Linux Build Status][badge-ci-build-x86_64-unknown-linux-musl]][ci-staging]   |
|            macOS | `x86_64-apple-darwin`         | [![macOS Build Status][badge-ci-build-x86_64-apple-darwin]][ci-staging]         |
|          Windows | `x86_64-pc-windows-msvc`      | [![Windows Build Status][badge-ci-build-x86_64-pc-windows-msvc]][ci-staging]    |

### Test (main branch)

| Operating System | Stable Rust                                                               | Nightly Rust                                                                |
| ---------------: | ------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|          FreeBSD | [![FreeBSD Stable Test Status][badge-ci-test-stable-freebsd]][ci-staging] | [![FreeBSD Nightly Test Status][badge-ci-test-nightly-freebsd]][ci-staging] |
|            Linux | [![Linux Stable Test Status][badge-ci-test-stable-linux]][ci-staging]     | [![Linux Nightly Test Status][badge-ci-test-nightly-linux]][ci-staging]     |
|            macOS | [![macOS Stable Test Status][badge-ci-test-stable-macos]][ci-staging]     | [![macOS Nightly Test Status][badge-ci-test-nightly-macos]][ci-staging]     |
|          Windows | [![Windows Stable Test Status][badge-ci-test-stable-windows]][ci-staging] | [![Windows Nightly Test Status][badge-ci-test-nightly-windows]][ci-staging] |

**Note**: The
[Minimum Supported Rust Version (MSRV)](https://github.com/rust-lang/rfcs/pull/2495)
is also tested and can be viewed in the [CI dashboard][ci-staging].

### Check (main branch)

|        | Status                                                |
| ------ | ----------------------------------------------------- |
| Lint   | [![Lint Status][badge-ci-check-lint]][ci-staging]     |
| Format | [![Format Status][badge-ci-check-format]][ci-staging] |

## Code of Conduct

This project adheres to the Contributor Covenant [code of
conduct][code-of-conduct]. By participating, you are expected to uphold this
code. Please report unacceptable behavior to fnichol@nichol.ca.

## Issues

If you have any problems with or questions about this project, please contact us
through a [GitHub issue][issues].

## Contributing

You are invited to contribute to new features, fixes, or updates, large or
small; we are always thrilled to receive pull requests, and do our best to
process them as fast as we can.

Before you start to code, we recommend discussing your plans through a [GitHub
issue][issues], especially for more ambitious contributions. This gives other
contributors a chance to point you in the right direction, give you feedback on
your design, and help you find out if someone else is working on the same thing.

## Release History

See the [changelog] for a full release history.

## Authors

Created and maintained by [Fletcher Nichol][fnichol] (<fnichol@nichol.ca>).

## License

Licensed under the MIT license ([LICENSE.txt][license]).

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the MIT license, shall be
licensed as above, without any additional terms or conditions.

[badge-bors]: https://bors.tech/images/badge_small.svg
[badge-ci-build-x86_64-unknown-freebsd]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-x86_64-unknown-freebsd.tar.gz
[badge-ci-build-arm-unknown-linux-gnueabihf]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-arm-unknown-linux-gnueabihf.tar.gz
[badge-ci-build-aarch64-unknown-linux-gnu]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-aarch64-unknown-linux-gnu.tar.gz
[badge-ci-build-i686-unknown-linux-gnu]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-i686-unknown-linux-gnu.tar.gz
[badge-ci-build-i686-unknown-linux-musl]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-i686-unknown-linux-musl.tar.gz
[badge-ci-build-x86_64-unknown-linux-gnu]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-x86_64-unknown-linux-gnu.tar.gz
[badge-ci-build-x86_64-unknown-linux-musl]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-x86_64-unknown-linux-musl.tar.gz
[badge-ci-build-x86_64-apple-darwin]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-x86_64-apple-darwin.zip
[badge-ci-build-x86_64-pc-windows-msvc]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=build-bin-names-x86_64-pc-windows-msvc.zip
[badge-ci-check-format]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=check&script=format
[badge-ci-check-lint]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=check&script=lint
[badge-ci-overall]:
  https://img.shields.io/cirrus/github/fnichol/names/main?style=flat-square
[badge-ci-test-nightly-freebsd]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-nightly-x86_64-unknown-freebsd
[badge-ci-test-nightly-linux]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-nightly-x86_64-unknown-linux-gnu
[badge-ci-test-nightly-macos]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-nightly-x86_64-apple-darwin
[badge-ci-test-nightly-windows]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-nightly-x86_64-pc-windows-msvc
[badge-ci-test-stable-freebsd]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-stable-x86_64-unknown-freebsd
[badge-ci-test-stable-linux]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-stable-x86_64-unknown-linux-gnu
[badge-ci-test-stable-macos]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-stable-x86_64-apple-darwin
[badge-ci-test-stable-windows]:
  https://img.shields.io/cirrus/github/fnichol/names/staging?style=flat-square&task=test-stable-x86_64-pc-windows-msvc
[badge-crate-dl]: https://img.shields.io/crates/d/names.svg?style=flat-square
[badge-docker-pulls]:
  https://img.shields.io/docker/pulls/fnichol/names.svg?style=flat-square
[badge-docs]: https://docs.rs/names/badge.svg?style=flat-square
[badge-github-dl]:
  https://img.shields.io/github/downloads/fnichol/names/total.svg
[badge-license]: https://img.shields.io/crates/l/names.svg?style=flat-square
[badge-version]: https://img.shields.io/crates/v/names.svg?style=flat-square
[bors-dashboard]: https://app.bors.tech/repositories/37173
[changelog]: https://github.com/fnichol/names/blob/main/CHANGELOG.md
[ci]: https://cirrus-ci.com/github/fnichol/names
[ci-staging]: https://cirrus-ci.com/github/fnichol/names/staging
[code-of-conduct]: https://github.com/fnichol/names/blob/main/CODE_OF_CONDUCT.md
[commonmark]: https://commonmark.org/
[crate]: https://crates.io/crates/names
[docker]: https://hub.docker.com/r/fnichol/names
[docs]: https://docs.rs/names
[fnichol]: https://github.com/fnichol
[github]: https://github.com/fnichol/names
[github-releases]: https://github.com/fnichol/names/releases
[issues]: https://github.com/fnichol/names/issues
[license]: https://github.com/fnichol/names/blob/main/LICENSE.txt
[nightly]: https://github.com/fnichol/names/releases/tag/nightly


================================================
FILE: README.tpl
================================================
<h1 align="center">
  <br/>
  {{crate}}
  <br/>
</h1>

<h4 align="center">
  Random name generator for Rust
</h4>

|                  |                                                                                          |
| ---------------: | ---------------------------------------------------------------------------------------- |
|               CI | [![CI Status][badge-ci-overall]][ci]<br /> [![Bors enabled][badge-bors]][bors-dashboard] |
|   Latest Version | [![Latest version][badge-version]][crate]                                                |
|    Documentation | [![Documentation][badge-docs]][docs]                                                     |
|  Crate Downloads | [![Crate downloads][badge-crate-dl]][crate]                                              |
| GitHub Downloads | [![Github downloads][badge-github-dl]][github-releases]                                  |
|     Docker Pulls | [![Docker pulls][badge-docker-pulls]][docker]                                            |
|          License | [![Crate license][badge-license]][github]                                                |

<details>
<summary><strong>Table of Contents</strong></summary>

<!-- toc -->

</details>

## CLI

### Usage

Simple! Run without any parameters, you get a name:

```console
> names
selfish-change
```

Need more? Tell it how many:

```console
> names 10
rustic-flag
nondescript-crayon
picayune-map
elderly-cough
skinny-jeans
neat-rock
aware-sponge
psychotic-coast
brawny-event
tender-oatmeal
```

Not random enough? How about adding a 4-number pad:

```console
> names --number 5
imported-rod-9680
thin-position-2344
hysterical-women-5647
volatile-pen-9210
diligent-grip-4520
```

If you're ever confused, at least there's help:

```console
> names --help
names 0.11.0
Fletcher Nichol <fnichol@nichol.ca>

A random name generator with results like "delirious-pail"

USAGE:
    names [FLAGS] [AMOUNT]

ARGS:
    <AMOUNT>    Number of names to generate [default: 1]

FLAGS:
    -h, --help       Prints help information
    -n, --number     Adds a random number to the name(s)
    -V, --version    Prints version information
```

### Installation

#### install.sh (Pre-Built Binaries)

An installer is provided at <https://fnichol.github.io/{{crate}}/install.sh>
which installs a suitable pre-built binary for common systems such as Linux,
macOS, Windows, and FreeBSD. It can be downloaded and run locally or piped into
a shell interpreter in the "curl-bash" style as shown below. Note that if you're
opposed to this idea, feel free to check some of the alternatives below.

To install the latest release for your system into `$HOME/bin`:

```sh
curl -sSf https://fnichol.github.io/{{crate}}/install.sh | sh
```

When the installer is run as `root` the installation directory defaults to
`/usr/local/bin`:

```sh
curl -sSf https://fnichol.github.io/{{crate}}/install.sh | sudo sh
```

A [nightly] release built from `HEAD` of the main branch is available which can
also be installed:

```sh
curl -sSf https://fnichol.github.io/{{crate}}/install.sh \
    | sh -s -- --release=nightly
```

For a full set of options, check out the help usage with:

```sh
curl -sSf https://fnichol.github.io/{{crate}}/install.sh | sh -s -- --help
```

#### GitHub Releasees (Pre-Built Binaries)

Each release comes with binary artifacts published in [GitHub
Releases][github-releases]. The `install.sh` program downloads its artifacts
from this location so this serves as a manual alternative. Each artifact ships
with MD5 and SHA256 checksums to help verify the artifact on a target system.

#### Docker Image

A minimal image ships with each release (including a [nightly] built version
from `HEAD` of the main branch) published to [Docker Hub][docker]. The
entrypoint invokes the binary directly, so any arguments to `docker run` will be
passed to the program. For example, to display the full help usage:

```sh
docker run fnichol/names --help
```

#### Cargo Install

If [Rust](https://rustup.rs/) is installed on your system, then installing with
Cargo is straight forward with:

```sh
cargo install {{crate}}
```

#### From Source

To install from source, you can clone the Git repository, build with Cargo and
copy the binary into a destination directory. This will build the project from
the latest commit on the main branch, which may not correspond to the latest
stable release:

```console
> git clone https://github.com/fnichol/{{crate}}.git
> cd {{crate}}
> cargo build --release
> cp ./target/release/{{crate}} /dest/path/
```

---

## Library

{{readme}}

## CI Status

### Build (main branch)

| Operating System | Target                        | Stable Rust                                                                     |
| ---------------: | ----------------------------- | ------------------------------------------------------------------------------- |
|          FreeBSD | `x86_64-unknown-freebsd`      | [![FreeBSD Build Status][badge-ci-build-x86_64-unknown-freebsd]][ci-staging]    |
|            Linux | `arm-unknown-linux-gnueabihf` | [![Linux Build Status][badge-ci-build-arm-unknown-linux-gnueabihf]][ci-staging] |
|            Linux | `aarch64-unknown-linux-gnu`   | [![Linux Build Status][badge-ci-build-aarch64-unknown-linux-gnu]][ci-staging]   |
|            Linux | `i686-unknown-linux-gnu`      | [![Linux Build Status][badge-ci-build-i686-unknown-linux-gnu]][ci-staging]      |
|            Linux | `i686-unknown-linux-musl`     | [![Linux Build Status][badge-ci-build-i686-unknown-linux-musl]][ci-staging]     |
|            Linux | `x86_64-unknown-linux-gnu`    | [![Linux Build Status][badge-ci-build-x86_64-unknown-linux-gnu]][ci-staging]    |
|            Linux | `x86_64-unknown-linux-musl`   | [![Linux Build Status][badge-ci-build-x86_64-unknown-linux-musl]][ci-staging]   |
|            macOS | `x86_64-apple-darwin`         | [![macOS Build Status][badge-ci-build-x86_64-apple-darwin]][ci-staging]         |
|          Windows | `x86_64-pc-windows-msvc`      | [![Windows Build Status][badge-ci-build-x86_64-pc-windows-msvc]][ci-staging]    |

### Test (main branch)

| Operating System | Stable Rust                                                               | Nightly Rust                                                                |
| ---------------: | ------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|          FreeBSD | [![FreeBSD Stable Test Status][badge-ci-test-stable-freebsd]][ci-staging] | [![FreeBSD Nightly Test Status][badge-ci-test-nightly-freebsd]][ci-staging] |
|            Linux | [![Linux Stable Test Status][badge-ci-test-stable-linux]][ci-staging]     | [![Linux Nightly Test Status][badge-ci-test-nightly-linux]][ci-staging]     |
|            macOS | [![macOS Stable Test Status][badge-ci-test-stable-macos]][ci-staging]     | [![macOS Nightly Test Status][badge-ci-test-nightly-macos]][ci-staging]     |
|          Windows | [![Windows Stable Test Status][badge-ci-test-stable-windows]][ci-staging] | [![Windows Nightly Test Status][badge-ci-test-nightly-windows]][ci-staging] |

**Note**: The
[Minimum Supported Rust Version (MSRV)](https://github.com/rust-lang/rfcs/pull/2495)
is also tested and can be viewed in the [CI dashboard][ci-staging].

### Check (main branch)

|        | Status                                                |
| ------ | ----------------------------------------------------- |
| Lint   | [![Lint Status][badge-ci-check-lint]][ci-staging]     |
| Format | [![Format Status][badge-ci-check-format]][ci-staging] |

## Code of Conduct

This project adheres to the Contributor Covenant [code of
conduct][code-of-conduct]. By participating, you are expected to uphold this
code. Please report unacceptable behavior to fnichol@nichol.ca.

## Issues

If you have any problems with or questions about this project, please contact us
through a [GitHub issue][issues].

## Contributing

You are invited to contribute to new features, fixes, or updates, large or
small; we are always thrilled to receive pull requests, and do our best to
process them as fast as we can.

Before you start to code, we recommend discussing your plans through a [GitHub
issue][issues], especially for more ambitious contributions. This gives other
contributors a chance to point you in the right direction, give you feedback on
your design, and help you find out if someone else is working on the same thing.

## Release History

See the [changelog] for a full release history.

## Authors

Created and maintained by [Fletcher Nichol][fnichol] (<fnichol@nichol.ca>).

## License

Licensed under the MIT license ([LICENSE.txt][license]).

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the MIT license, shall be
licensed as above, without any additional terms or conditions.

[badge-bors]: https://bors.tech/images/badge_small.svg
[badge-ci-build-x86_64-unknown-freebsd]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-x86_64-unknown-freebsd.tar.gz
[badge-ci-build-arm-unknown-linux-gnueabihf]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-arm-unknown-linux-gnueabihf.tar.gz
[badge-ci-build-aarch64-unknown-linux-gnu]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-aarch64-unknown-linux-gnu.tar.gz
[badge-ci-build-i686-unknown-linux-gnu]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-i686-unknown-linux-gnu.tar.gz
[badge-ci-build-i686-unknown-linux-musl]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-i686-unknown-linux-musl.tar.gz
[badge-ci-build-x86_64-unknown-linux-gnu]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-x86_64-unknown-linux-gnu.tar.gz
[badge-ci-build-x86_64-unknown-linux-musl]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-x86_64-unknown-linux-musl.tar.gz
[badge-ci-build-x86_64-apple-darwin]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-x86_64-apple-darwin.zip
[badge-ci-build-x86_64-pc-windows-msvc]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=build-bin-{{crate}}-x86_64-pc-windows-msvc.zip
[badge-ci-check-format]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=check&script=format
[badge-ci-check-lint]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=check&script=lint
[badge-ci-overall]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/main?style=flat-square
[badge-ci-test-nightly-freebsd]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-nightly-x86_64-unknown-freebsd
[badge-ci-test-nightly-linux]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-nightly-x86_64-unknown-linux-gnu
[badge-ci-test-nightly-macos]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-nightly-x86_64-apple-darwin
[badge-ci-test-nightly-windows]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-nightly-x86_64-pc-windows-msvc
[badge-ci-test-stable-freebsd]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-stable-x86_64-unknown-freebsd
[badge-ci-test-stable-linux]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-stable-x86_64-unknown-linux-gnu
[badge-ci-test-stable-macos]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-stable-x86_64-apple-darwin
[badge-ci-test-stable-windows]:
  https://img.shields.io/cirrus/github/fnichol/{{crate}}/staging?style=flat-square&task=test-stable-x86_64-pc-windows-msvc
[badge-crate-dl]:
  https://img.shields.io/crates/d/{{crate}}.svg?style=flat-square
[badge-docker-pulls]:
  https://img.shields.io/docker/pulls/fnichol/{{crate}}.svg?style=flat-square
[badge-docs]: https://docs.rs/{{crate}}/badge.svg?style=flat-square
[badge-github-dl]:
  https://img.shields.io/github/downloads/fnichol/{{crate}}/total.svg
[badge-license]: https://img.shields.io/crates/l/{{crate}}.svg?style=flat-square
[badge-version]: https://img.shields.io/crates/v/{{crate}}.svg?style=flat-square
[bors-dashboard]: https://app.bors.tech/repositories/37173
[changelog]: https://github.com/fnichol/{{crate}}/blob/main/CHANGELOG.md
[ci]: https://cirrus-ci.com/github/fnichol/{{crate}}
[ci-staging]: https://cirrus-ci.com/github/fnichol/{{crate}}/staging
[code-of-conduct]:
  https://github.com/fnichol/{{crate}}/blob/main/CODE_OF_CONDUCT.md
[commonmark]: https://commonmark.org/
[crate]: https://crates.io/crates/{{crate}}
[docker]: https://hub.docker.com/r/fnichol/{{crate}}
[docs]: https://docs.rs/{{crate}}
[fnichol]: https://github.com/fnichol
[github]: https://github.com/fnichol/{{crate}}
[github-releases]: https://github.com/fnichol/{{crate}}/releases
[issues]: https://github.com/fnichol/{{crate}}/issues
[license]: https://github.com/fnichol/{{crate}}/blob/main/LICENSE.txt
[nightly]: https://github.com/fnichol/{{crate}}/releases/tag/nightly


================================================
FILE: build.rs
================================================
use std::env;
use std::fs::File;
use std::io::{self, BufRead, BufReader, BufWriter, Write};
use std::path::Path;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    update_version_if_nightly();

    let out_dir = env::var("OUT_DIR")?;
    let out_dir = Path::new(&out_dir);
    let src_dir = Path::new("data");

    generate(
        src_dir.join("adjectives.txt"),
        out_dir.join("adjectives.rs"),
    )?;
    generate(src_dir.join("nouns.txt"), out_dir.join("nouns.rs"))?;
    Ok(())
}

fn generate(src_path: impl AsRef<Path>, dst_path: impl AsRef<Path>) -> io::Result<()> {
    let src = BufReader::new(File::open(src_path.as_ref())?);
    let mut dst = BufWriter::new(File::create(dst_path.as_ref())?);

    writeln!(dst, "[")?;
    for word in src.lines() {
        writeln!(dst, "\"{}\",", &word.unwrap())?;
    }
    writeln!(dst, "]")
}

fn update_version_if_nightly() {
    println!("cargo:rerun-if-env-changed=NIGHTLY_BUILD");
    if let Ok(date) = std::env::var("NIGHTLY_BUILD") {
        println!(
            "cargo:rustc-env=CARGO_PKG_VERSION={}-nightly.{}",
            std::env::var("CARGO_PKG_VERSION")
                .unwrap()
                .split('-')
                .next()
                .unwrap(),
            date,
        );
    }
}


================================================
FILE: data/adjectives.txt
================================================
aback
abaft
abandoned
abashed
aberrant
abhorrent
abiding
abject
ablaze
able
abnormal
aboard
aboriginal
abortive
abounding
abrasive
abrupt
absent
absorbed
absorbing
abstracted
absurd
abundant
abusive
acceptable
accessible
accidental
accurate
acid
acidic
acoustic
acrid
actually
ad
adamant
adaptable
addicted
adhesive
adjoining
adorable
adventurous
afraid
aggressive
agonizing
agreeable
ahead
ajar
alcoholic
alert
alike
alive
alleged
alluring
aloof
amazing
ambiguous
ambitious
amuck
amused
amusing
ancient
angry
animated
annoyed
annoying
anxious
apathetic
aquatic
aromatic
arrogant
ashamed
aspiring
assorted
astonishing
attractive
auspicious
automatic
available
average
awake
aware
awesome
awful
axiomatic
bad
barbarous
bashful
bawdy
beautiful
befitting
belligerent
beneficial
bent
berserk
best
better
bewildered
big
billowy
bite-sized
bitter
bizarre
black
black-and-white
bloody
blue
blue-eyed
blushing
boiling
boorish
bored
boring
bouncy
boundless
brainy
brash
brave
brawny
breakable
breezy
brief
bright
broad
broken
brown
bumpy
burly
bustling
busy
cagey
calculating
callous
calm
capable
capricious
careful
careless
caring
cautious
ceaseless
certain
changeable
charming
cheap
cheerful
chemical
chief
childlike
chilly
chivalrous
chubby
chunky
clammy
classy
clean
clear
clever
cloistered
closed
cloudy
clumsy
cluttered
coherent
cold
colorful
colossal
combative
comfortable
common
complete
complex
concerned
condemned
confused
conscious
cooing
cool
cooperative
coordinated
courageous
cowardly
crabby
craven
crazy
creepy
crooked
crowded
cruel
cuddly
cultured
cumbersome
curious
curly
curved
curvy
cut
cute
cynical
daffy
daily
damaged
damaging
damp
dangerous
dapper
dark
dashing
dazzling
dead
deadpan
deafening
dear
debonair
decisive
decorous
deep
deeply
defeated
defective
defiant
delicate
delicious
delightful
delirious
demonic
dependent
depressed
deranged
descriptive
deserted
detailed
determined
devilish
didactic
different
difficult
diligent
direful
dirty
disagreeable
disastrous
discreet
disgusted
disgusting
disillusioned
dispensable
distinct
disturbed
divergent
dizzy
domineering
doubtful
drab
draconian
dramatic
dreary
drunk
dry
dull
dusty
dynamic
dysfunctional
eager
early
earsplitting
earthy
easy
eatable
economic
educated
efficacious
efficient
eight
elastic
elated
elderly
electric
elegant
elfin
elite
embarrassed
eminent
empty
enchanted
enchanting
encouraging
endurable
energetic
enormous
entertaining
enthusiastic
envious
equable
equal
erect
erratic
ethereal
evanescent
evasive
even
excellent
excited
exciting
exclusive
exotic
expensive
extra-large
extra-small
exuberant
exultant
fabulous
faded
faint
fair
faithful
fallacious
false
familiar
famous
fanatical
fancy
fantastic
far
far-flung
fascinated
fast
fat
faulty
fearful
fearless
feeble
feigned
female
fertile
festive
few
fierce
filthy
fine
finicky
first
five
fixed
flagrant
flaky
flashy
flat
flawless
flimsy
flippant
flowery
fluffy
fluttering
foamy
foolish
foregoing
forgetful
fortunate
four
fragile
frail
frantic
free
freezing
frequent
fresh
fretful
friendly
frightened
frightening
full
fumbling
functional
funny
furry
furtive
future
futuristic
fuzzy
gabby
gainful
gamy
gaping
garrulous
gaudy
general
gentle
giant
giddy
gifted
gigantic
glamorous
gleaming
glib
glistening
glorious
glossy
godly
good
goofy
gorgeous
graceful
grandiose
grateful
gratis
gray
greasy
great
greedy
green
grey
grieving
groovy
grotesque
grouchy
grubby
gruesome
grumpy
guarded
guiltless
gullible
gusty
guttural
habitual
half
hallowed
halting
handsome
handsomely
handy
hanging
hapless
happy
hard
hard-to-find
harmonious
harsh
hateful
heady
healthy
heartbreaking
heavenly
heavy
hellish
helpful
helpless
hesitant
hideous
high
high-pitched
highfalutin
hilarious
hissing
historical
holistic
hollow
homeless
homely
honorable
horrible
hospitable
hot
huge
hulking
humdrum
humorous
hungry
hurried
hurt
hushed
husky
hypnotic
hysterical
icky
icy
idiotic
ignorant
ill
ill-fated
ill-informed
illegal
illustrious
imaginary
immense
imminent
impartial
imperfect
impolite
important
imported
impossible
incandescent
incompetent
inconclusive
incredible
industrious
inexpensive
infamous
innate
innocent
inquisitive
insidious
instinctive
intelligent
interesting
internal
invincible
irate
irritating
itchy
jaded
jagged
jazzy
jealous
jittery
jobless
jolly
joyous
judicious
juicy
jumbled
jumpy
juvenile
kaput
keen
kind
kindhearted
kindly
knotty
knowing
knowledgeable
known
labored
lackadaisical
lacking
lame
lamentable
languid
large
last
late
laughable
lavish
lazy
lean
learned
left
legal
lethal
level
lewd
light
like
likeable
limping
literate
little
lively
living
lonely
long
long-term
longing
loose
lopsided
loud
loutish
lovely
loving
low
lowly
lucky
ludicrous
lumpy
lush
luxuriant
lying
lyrical
macabre
macho
maddening
madly
magenta
magical
magnificent
majestic
makeshift
male
malicious
mammoth
maniacal
many
marked
married
marvelous
massive
material
materialistic
mature
mean
measly
meaty
medical
meek
mellow
melodic
melted
merciful
mere
messy
mighty
military
milky
mindless
miniature
minor
miscreant
misty
mixed
moaning
modern
moldy
momentous
motionless
mountainous
muddled
mundane
murky
mushy
mute
mysterious
naive
nappy
narrow
nasty
natural
naughty
nauseating
near
neat
nebulous
necessary
needless
needy
neighborly
nervous
new
next
nice
nifty
nimble
nine
nippy
noiseless
noisy
nonchalant
nondescript
nonstop
normal
nostalgic
nosy
noxious
null
numberless
numerous
nutritious
nutty
oafish
obedient
obeisant
obese
obnoxious
obscene
obsequious
observant
obsolete
obtainable
oceanic
odd
offbeat
old
old-fashioned
omniscient
one
onerous
open
opposite
optimal
orange
ordinary
organic
ossified
outgoing
outrageous
outstanding
oval
overconfident
overjoyed
overrated
overt
overwrought
painful
painstaking
pale
paltry
panicky
panoramic
parallel
parched
parsimonious
past
pastoral
pathetic
peaceful
penitent
perfect
periodic
permissible
perpetual
petite
phobic
physical
picayune
pink
piquant
placid
plain
plant
plastic
plausible
pleasant
plucky
pointless
poised
polite
political
poor
possessive
possible
powerful
precious
premium
present
pretty
previous
pricey
prickly
private
probable
productive
profuse
protective
proud
psychedelic
psychotic
public
puffy
pumped
puny
purple
purring
pushy
puzzled
puzzling
quack
quaint
quarrelsome
questionable
quick
quickest
quiet
quirky
quixotic
quizzical
rabid
racial
ragged
rainy
rambunctious
rampant
rapid
rare
raspy
ratty
ready
real
rebel
receptive
recondite
red
redundant
reflective
regular
relieved
remarkable
reminiscent
repulsive
resolute
resonant
responsible
rhetorical
rich
right
righteous
rightful
rigid
ripe
ritzy
roasted
robust
romantic
roomy
rotten
rough
round
royal
ruddy
rude
rural
rustic
ruthless
sable
sad
safe
salty
same
sassy
satisfying
savory
scandalous
scarce
scared
scary
scattered
scientific
scintillating
scrawny
screeching
second
second-hand
secret
secretive
sedate
seemly
selective
selfish
separate
serious
shaggy
shaky
shallow
sharp
shiny
shivering
shocking
short
shrill
shut
shy
sick
silent
silky
silly
simple
simplistic
sincere
six
skillful
skinny
sleepy
slim
slimy
slippery
sloppy
slow
small
smart
smelly
smiling
smoggy
smooth
sneaky
snobbish
snotty
soft
soggy
solid
somber
sophisticated
sordid
sore
sour
sparkling
special
spectacular
spicy
spiffy
spiky
spiritual
spiteful
splendid
spooky
spotless
spotted
spotty
spurious
squalid
square
squealing
squeamish
staking
stale
standing
statuesque
steadfast
steady
steep
stereotyped
sticky
stiff
stimulating
stingy
stormy
straight
strange
striped
strong
stupendous
stupid
sturdy
subdued
subsequent
substantial
successful
succinct
sudden
sulky
super
superb
superficial
supreme
swanky
sweet
sweltering
swift
symptomatic
synonymous
taboo
tacit
tacky
talented
tall
tame
tan
tangible
tangy
tart
tasteful
tasteless
tasty
tawdry
tearful
tedious
teeny
teeny-tiny
telling
temporary
ten
tender
tense
tenuous
terrible
terrific
tested
testy
thankful
therapeutic
thick
thin
thinkable
third
thirsty
thoughtful
thoughtless
threatening
three
thundering
tidy
tight
tightfisted
tiny
tired
tiresome
toothsome
torpid
tough
towering
tranquil
trashy
tremendous
tricky
trite
troubled
truculent
true
truthful
two
typical
ubiquitous
ugliest
ugly
ultra
unable
unaccountable
unadvised
unarmed
unbecoming
unbiased
uncovered
understood
undesirable
unequal
unequaled
uneven
unhealthy
uninterested
unique
unkempt
unknown
unnatural
unruly
unsightly
unsuitable
untidy
unused
unusual
unwieldy
unwritten
upbeat
uppity
upset
uptight
used
useful
useless
utopian
utter
uttermost
vacuous
vagabond
vague
valuable
various
vast
vengeful
venomous
verdant
versed
victorious
vigorous
violent
violet
vivacious
voiceless
volatile
voracious
vulgar
wacky
waggish
waiting
wakeful
wandering
wanting
warlike
warm
wary
wasteful
watery
weak
wealthy
weary
well-groomed
well-made
well-off
well-to-do
wet
whimsical
whispering
white
whole
wholesale
wicked
wide
wide-eyed
wiggly
wild
willing
windy
wiry
wise
wistful
witty
woebegone
womanly
wonderful
wooden
woozy
workable
worried
worthless
wrathful
wretched
wrong
wry
yellow
yielding
young
youthful
yummy
zany
zealous
zesty
zippy
zonked


================================================
FILE: data/nouns.txt
================================================
able
account
achieve
achiever
acoustics
act
action
activity
actor
addition
adjustment
advertisement
advice
aftermath
afternoon
afterthought
agreement
air
airplane
airport
alarm
alley
amount
amusement
anger
angle
animal
answer
ant
ants
apparatus
apparel
apple
apples
appliance
approval
arch
argument
arithmetic
arm
army
art
attack
attempt
attention
attraction
aunt
authority
babies
baby
back
badge
bag
bait
balance
ball
balloon
balls
banana
band
base
baseball
basin
basket
basketball
bat
bath
battle
bead
beam
bean
bear
bears
beast
bed
bedroom
beds
bee
beef
beetle
beggar
beginner
behavior
belief
believe
bell
bells
berry
bike
bikes
bird
birds
birth
birthday
bit
bite
blade
blood
blow
board
boat
boats
body
bomb
bone
book
books
boot
border
bottle
boundary
box
boy
boys
brain
brake
branch
brass
bread
breakfast
breath
brick
bridge
brother
brothers
brush
bubble
bucket
building
bulb
bun
burn
burst
bushes
business
butter
button
cabbage
cable
cactus
cake
cakes
calculator
calendar
camera
camp
can
cannon
canvas
cap
caption
car
card
care
carpenter
carriage
cars
cart
cast
cat
cats
cattle
cause
cave
celery
cellar
cemetery
cent
chain
chair
chairs
chalk
chance
change
channel
cheese
cherries
cherry
chess
chicken
chickens
children
chin
church
circle
clam
class
clock
clocks
cloth
cloud
clouds
clover
club
coach
coal
coast
coat
cobweb
coil
collar
color
comb
comfort
committee
company
comparison
competition
condition
connection
control
cook
copper
copy
cord
cork
corn
cough
country
cover
cow
cows
crack
cracker
crate
crayon
cream
creator
creature
credit
crib
crime
crook
crow
crowd
crown
crush
cry
cub
cup
current
curtain
curve
cushion
dad
daughter
day
death
debt
decision
deer
degree
design
desire
desk
destruction
detail
development
digestion
dime
dinner
dinosaurs
direction
dirt
discovery
discussion
disease
disgust
distance
distribution
division
dock
doctor
dog
dogs
doll
dolls
donkey
door
downtown
drain
drawer
dress
drink
driving
drop
drug
drum
duck
ducks
dust
ear
earth
earthquake
edge
education
effect
egg
eggnog
eggs
elbow
end
engine
error
event
example
exchange
existence
expansion
experience
expert
eye
eyes
face
fact
fairies
fall
family
fan
fang
farm
farmer
father
faucet
fear
feast
feather
feeling
feet
fiction
field
fifth
fight
finger
fire
fireman
fish
flag
flame
flavor
flesh
flight
flock
floor
flower
flowers
fly
fog
fold
food
foot
force
fork
form
fowl
frame
friction
friend
friends
frog
frogs
front
fruit
fuel
furniture
galley
game
garden
gate
geese
ghost
giants
giraffe
girl
girls
glass
glove
glue
goat
gold
goldfish
good-bye
goose
government
governor
grade
grain
grandfather
grandmother
grape
grass
grip
ground
group
growth
guide
guitar
gun
hair
haircut
hall
hammer
hand
hands
harbor
harmony
hat
hate
head
health
hearing
heart
heat
help
hen
hill
history
hobbies
hole
holiday
home
honey
hook
hope
horn
horse
horses
hose
hospital
hot
hour
house
houses
humor
hydrant
ice
icicle
idea
impulse
income
increase
industry
ink
insect
instrument
insurance
interest
invention
iron
island
jail
jam
jar
jeans
jelly
jellyfish
jewel
join
joke
journey
judge
juice
jump
kettle
key
kick
kiss
kite
kitten
kittens
kitty
knee
knife
knot
knowledge
laborer
lace
ladybug
lake
lamp
land
language
laugh
lawyer
lead
leaf
learning
leather
leg
legs
letter
letters
lettuce
level
library
lift
light
limit
line
linen
lip
liquid
list
lizards
loaf
lock
locket
look
loss
love
low
lumber
lunch
lunchroom
machine
magic
maid
mailbox
man
manager
map
marble
mark
market
mask
mass
match
meal
measure
meat
meeting
memory
men
metal
mice
middle
milk
mind
mine
minister
mint
minute
mist
mitten
mom
money
monkey
month
moon
morning
mother
motion
mountain
mouth
move
muscle
music
nail
name
nation
neck
need
needle
nerve
nest
net
news
night
noise
north
nose
note
notebook
number
nut
oatmeal
observation
ocean
offer
office
oil
operation
opinion
orange
oranges
order
organization
ornament
oven
owl
owner
page
pail
pain
paint
pan
pancake
paper
parcel
parent
park
part
partner
party
passenger
paste
patch
payment
peace
pear
pen
pencil
person
pest
pet
pets
pickle
picture
pie
pies
pig
pigs
pin
pipe
pizzas
place
plane
planes
plant
plantation
plants
plastic
plate
play
playground
pleasure
plot
plough
pocket
point
poison
police
polish
pollution
popcorn
porter
position
pot
potato
powder
power
price
print
prison
process
produce
profit
property
prose
protest
pull
pump
punishment
purpose
push
quarter
quartz
queen
question
quicksand
quiet
quill
quilt
quince
quiver
rabbit
rabbits
rail
railway
rain
rainstorm
rake
range
rat
rate
ray
reaction
reading
reason
receipt
recess
record
regret
relation
religion
representative
request
respect
rest
reward
rhythm
rice
riddle
rifle
ring
rings
river
road
robin
rock
rod
roll
roof
room
root
rose
route
rub
rule
run
sack
sail
salt
sand
scale
scarecrow
scarf
scene
scent
school
science
scissors
screw
sea
seashore
seat
secretary
seed
selection
self
sense
servant
shade
shake
shame
shape
sheep
sheet
shelf
ship
shirt
shock
shoe
shoes
shop
show
side
sidewalk
sign
silk
silver
sink
sister
sisters
size
skate
skin
skirt
sky
slave
sleep
sleet
slip
slope
smash
smell
smile
smoke
snail
snails
snake
snakes
sneeze
snow
soap
society
sock
soda
sofa
son
song
songs
sort
sound
soup
space
spade
spark
spiders
sponge
spoon
spot
spring
spy
square
squirrel
stage
stamp
star
start
statement
station
steam
steel
stem
step
stew
stick
sticks
stitch
stocking
stomach
stone
stop
store
story
stove
stranger
straw
stream
street
stretch
string
structure
substance
sugar
suggestion
suit
summer
sun
support
surprise
sweater
swim
swing
system
table
tail
talk
tank
taste
tax
teaching
team
teeth
temper
tendency
tent
territory
test
texture
theory
thing
things
thought
thread
thrill
throat
throne
thumb
thunder
ticket
tiger
time
tin
title
toad
toe
toes
tomatoes
tongue
tooth
toothbrush
toothpaste
top
touch
town
toy
toys
trade
trail
train
trains
tramp
transport
tray
treatment
tree
trees
trick
trip
trouble
trousers
truck
trucks
tub
turkey
turn
twig
twist
umbrella
uncle
underwear
unit
use
vacation
value
van
vase
vegetable
veil
vein
verse
vessel
vest
view
visitor
voice
volcano
volleyball
voyage
walk
wall
war
wash
waste
watch
water
wave
waves
wax
way
wealth
weather
week
weight
wheel
whip
whistle
wilderness
wind
window
wine
wing
winter
wire
wish
woman
women
wood
wool
word
work
worm
wound
wren
wrench
wrist
writer
writing
yak
yam
yard
yarn
year
yoke
zebra
zephyr
zinc
zipper
zoo


================================================
FILE: docs/install.sh
================================================
#!/usr/bin/env sh
# shellcheck shell=sh disable=SC3043

print_usage() {
  local program version author default_dest default_platform
  program="$1"
  version="$2"
  author="$3"
  bin="$4"
  default_dest="$5"
  default_platform="$6"

  need_cmd sed

  echo "$program $version

    Installs a binary release of $bin for supported platforms

    USAGE:
        $program [OPTIONS] [--]

    OPTIONS:
        -h, --help                Prints help information
        -d, --destination=<DEST>  Destination directory for installation
                                  [default: $default_dest]
        -p, --platform=<PLATFORM> Platform type to install
                                  [examples: linux-x86_64, darwin-x86_64]
                                  [default: $default_platform]
        -r, --release=<RELEASE>   Release version
                                  [examples: latest, 1.2.3, nightly]
                                  [default: latest]
        -V, --version             Prints version information

    EXAMPLES:
        # Installs the latest release into \`\$$HOME/bin\`
        $program

    AUTHOR:
        $author
    " | sed 's/^ \{1,4\}//g'
}

main() {
  set -eu
  if [ -n "${DEBUG:-}" ]; then set -v; fi
  if [ -n "${TRACE:-}" ]; then set -xv; fi

  local program version author
  program="install.sh"
  version="0.2.0"
  author="Fletcher Nichol <fnichol@nichol.ca>"

  local gh_repo bin
  gh_repo="fnichol/names"
  bin="names"

  parse_cli_args "$program" "$version" "$author" "$bin" "$@"
  local dest platform release
  dest="$DEST"
  platform="$PLATFORM"
  release="$RELEASE"
  unset DEST PLATFORM RELEASE

  need_cmd basename

  setup_cleanups
  setup_traps trap_cleanups

  local initial_dir
  initial_dir="$PWD"

  section "Downloading, verifying, and installing '$bin'"

  if [ "$release" = "latest" ]; then
    info_start "Determining latest release for '$bin'"
    release="$(latest_release "$gh_repo")" \
      || die "Could not find latest release for '$bin' in repo '$gh_repo'"
    info_end
  fi

  local asset_url
  info_start \
    "Determining asset URL for '$bin' release '$release' on '$platform'"
  asset_url="$(asset_url "$gh_repo" "$bin" "$release" "$platform")" \
    || die "Unsupported platform '$platform' for '$bin' release '$release'"
  info_end

  local tmpdir
  tmpdir="$(mktemp_directory)"
  cleanup_directory "$tmpdir"

  local asset
  asset="$(basename "$asset_url")"
  section "Downloading assets for '$asset'"
  download "$asset_url" "$tmpdir/$asset"
  download "$asset_url.md5" "$tmpdir/$asset.md5"
  download "$asset_url.sha256" "$tmpdir/$asset.sha256"

  section "Verifying '$asset'"
  cd "$tmpdir"
  verify_asset_md5 "$asset" || die "Failed to verify MD5 checksum"
  verify_asset_sha256 "$asset" || die "Failed to verify SHA256 checksum"

  section "Installing '$asset'"
  extract_asset "$asset" || die "Failed to extract asset"
  cd "$initial_dir"
  local asset_bin
  asset_bin="${asset%%.tar.gz}"
  asset_bin="${asset_bin%%.zip}"
  install_bin "$tmpdir/$asset_bin" "$dest/$bin"

  section "Installation of '$bin' release '$release' complete"
}

parse_cli_args() {
  local program version author bin
  program="$1"
  shift
  version="$1"
  shift
  author="$1"
  shift
  bin="$1"
  shift

  need_cmd id
  need_cmd uname
  need_cmd tr

  local os_type cpu_type plat dest
  os_type="$(uname -s | tr '[:upper:]' '[:lower:]')"
  cpu_type="$(uname -m | tr '[:upper:]' '[:lower:]')"
  plat="$os_type-$cpu_type"
  if [ "$(id -u)" -eq 0 ]; then
    dest="/usr/local/bin"
  else
    dest="$HOME/bin"
  fi

  DEST="$dest"
  PLATFORM="$plat"
  RELEASE="latest"

  OPTIND=1
  while getopts "d:hp:r:V-:" arg; do
    case "$arg" in
      d)
        DEST="$OPTARG"
        ;;
      h)
        print_usage "$program" "$version" "$author" "$bin" "$dest" "$plat"
        exit 0
        ;;
      p)
        PLATFORM="$OPTARG"
        ;;
      r)
        RELEASE="$OPTARG"
        ;;
      V)
        print_version "$program" "$version" "$plat"
        exit 0
        ;;
      -)
        long_optarg="${OPTARG#*=}"
        case "$OPTARG" in
          destination=?*)
            DEST="$long_optarg"
            ;;
          destination*)
            print_usage "$program" "$version" "$author" "$bin" "$dest" "$plat" >&2
            die "missing required argument for --$OPTARG option"
            ;;
          help)
            print_usage "$program" "$version" "$author" "$bin" "$dest" "$plat"
            exit 0
            ;;
          platform=?*)
            PLATFORM="$long_optarg"
            ;;
          platform*)
            print_usage "$program" "$version" "$author" "$bin" "$dest" "$plat" >&2
            die "missing required argument for --$OPTARG option"
            ;;
          release=?*)
            RELEASE="$long_optarg"
            ;;
          release*)
            print_usage "$program" "$version" "$author" "$bin" "$dest" "$plat" >&2
            die "missing required argument for --$OPTARG option"
            ;;
          version)
            print_version "$program" "$version" "true"
            exit 0
            ;;
          '')
            # "--" terminates argument processing
            break
            ;;
          *)
            print_usage "$program" "$version" "$author" "$bin" "$dest" "$plat" >&2
            die "invalid argument --$OPTARG"
            ;;
        esac
        ;;
      \?)
        print_usage "$program" "$version" "$author" "$bin" "$dest" "$plat" >&2
        die "invalid argument; arg=-$OPTARG"
        ;;
    esac
  done
  shift "$((OPTIND - 1))"
}

latest_release() {
  local gh_repo
  gh_repo="$1"

  need_cmd awk

  local tmpfile
  tmpfile="$(mktemp_file)"
  cleanup_file "$tmpfile"

  download \
    "https://api.github.com/repos/$gh_repo/releases/latest" \
    "$tmpfile" \
    >/dev/null
  awk '
    BEGIN { FS="\""; RS="," }
    $2 == "tag_name" { sub(/^v/, "", $4); print $4 }
  ' "$tmpfile"
}

asset_url() {
  local repo bin release platform
  repo="$1"
  bin="$2"
  release="$3"
  platform="$4"
  if [ "$release" != "nightly" ]; then
    release="v$release"
  fi

  need_cmd awk

  local base_url manifest_url
  base_url="https://github.com/$repo/releases/download/$release"
  manifest_url="$base_url/$bin.manifest.txt"

  local tmpfile
  tmpfile="$(mktemp_file)"
  cleanup_file "$tmpfile"

  download "$manifest_url" "$tmpfile" >/dev/null
  awk -v platform="$platform" -v base_url="$base_url" '
    $1 == platform { print base_url "/" $2; found = 1; exit }
    END { if (!found) { exit 1 } }
  ' "$tmpfile" \
    || {
      echo >&2
      warn "Cannot find platform entry for '$platform' in $manifest_url" >&2
      return 1
    }
}

verify_asset_sha256() {
  local asset
  asset="$1"

  need_cmd uname

  info "Verifying SHA256 checksum"
  case "$(uname -s)" in
    FreeBSD)
      if check_cmd sha256; then
        need_cmd awk
        indent sha256 -c "$(awk '{print $1}' "$asset.sha256")" "$asset"
      fi
      ;;
    Linux)
      if check_cmd sha256sum; then
        indent sha256sum -c "$asset.sha256"
      fi
      ;;
    Darwin)
      if check_cmd shasum; then
        indent shasum -c "$asset.sha256"
      fi
      ;;
  esac
}

verify_asset_md5() {
  local asset
  asset="$1"

  need_cmd uname

  info "Verifying MD5 checksum"
  case "$(uname -s)" in
    FreeBSD)
      if check_cmd md5; then
        need_cmd awk
        indent md5 -c "$(awk '{print $1}' "$asset.md5")" "$asset"
      fi
      ;;
    Linux)
      if check_cmd md5sum; then
        indent md5sum -c "$asset.md5"
      fi
      ;;
    Darwin)
      if check_cmd md5; then
        need_cmd awk
        local expected actual
        expected="$(awk '{ print $1 }' "$asset.md5")"
        actual="$(md5 "$asset" | awk '{ print $NF }')"
        if [ "$expected" = "$actual" ]; then
          indent echo "$asset: OK"
        else
          indent echo "$asset: FAILED"
          indent echo "md5: WARNING: 1 computed checksum did NOT match"
          return 1
        fi
      fi
      ;;
  esac
}

extract_asset() {
  local asset
  asset="$1"

  info "Extracting $asset"
  case "$asset" in
    *.tar.gz)
      need_cmd tar
      need_cmd zcat
      zcat "$asset" | indent tar xvf -
      ;;
    *.zip)
      need_cmd unzip
      indent unzip "$asset"
      ;;
  esac
}

install_bin() {
  local src dest
  src="$1"
  dest="$2"

  need_cmd dirname
  need_cmd install
  need_cmd mkdir

  info_start "Installing '$dest'"
  mkdir -p "$(dirname "$dest")"
  install -p -m 755 "$src" "$dest"
  info_end
}

# BEGIN: libsh.sh

#
# Copyright 2019 Fletcher Nichol and/or applicable contributors.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license (see
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. This
# file may not be copied, modified, or distributed except according to those
# terms.
#
# libsh.sh
# --------
# project: https://github.com/fnichol/libsh
# author: Fletcher Nichol <fnichol@nichol.ca>
# version: 0.9.0
# distribution: libsh.full-minified.sh
# commit-hash: e155f96bc281060342da4a19c26bf896f47de09c
# commit-date: 2021-04-14
# artifact: https://github.com/fnichol/libsh/releases/download/v0.9.0/libsh.full.sh
# source: https://github.com/fnichol/libsh/tree/v0.9.0
# archive: https://github.com/fnichol/libsh/archive/v0.9.0.tar.gz
#
if [ -n "${KSH_VERSION:-}" ]; then
  eval "local() { return 0; }"
fi
# shellcheck disable=SC2120
mktemp_directory() {
  need_cmd mktemp
  if [ -n "${1:-}" ]; then
    mktemp -d "$1/tmp.XXXXXX"
  else
    mktemp -d 2>/dev/null || mktemp -d -t tmp
  fi
}
# shellcheck disable=SC2120
mktemp_file() {
  need_cmd mktemp
  if [ -n "${1:-}" ]; then
    mktemp "$1/tmp.XXXXXX"
  else
    mktemp 2>/dev/null || mktemp -t tmp
  fi
}
trap_cleanup_files() {
  set +e
  if [ -n "${__CLEANUP_FILES__:-}" ] && [ -f "$__CLEANUP_FILES__" ]; then
    local _file
    while read -r _file; do
      rm -f "$_file"
    done <"$__CLEANUP_FILES__"
    unset _file
    rm -f "$__CLEANUP_FILES__"
  fi
}
need_cmd() {
  if ! check_cmd "$1"; then
    die "Required command '$1' not found on PATH"
  fi
}
trap_cleanups() {
  set +e
  trap_cleanup_directories
  trap_cleanup_files
}
print_version() {
  local _program _version _verbose _sha _long_sha _date
  _program="$1"
  _version="$2"
  _verbose="${3:-false}"
  _sha="${4:-}"
  _long_sha="${5:-}"
  _date="${6:-}"
  if [ -z "$_sha" ] || [ -z "$_long_sha" ] || [ -z "$_date" ]; then
    if check_cmd git \
      && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
      if [ -z "$_sha" ]; then
        _sha="$(git show -s --format=%h)"
        if ! git diff-index --quiet HEAD --; then
          _sha="${_sha}-dirty"
        fi
      fi
      if [ -z "$_long_sha" ]; then
        _long_sha="$(git show -s --format=%H)"
        case "$_sha" in
          *-dirty) _long_sha="${_long_sha}-dirty" ;;
        esac
      fi
      if [ -z "$_date" ]; then
        _date="$(git show -s --format=%ad --date=short)"
      fi
    fi
  fi
  if [ -n "$_sha" ] && [ -n "$_date" ]; then
    echo "$_program $_version ($_sha $_date)"
  else
    echo "$_program $_version"
  fi
  if [ "$_verbose" = "true" ]; then
    echo "release: $_version"
    if [ -n "$_long_sha" ]; then
      echo "commit-hash: $_long_sha"
    fi
    if [ -n "$_date" ]; then
      echo "commit-date: $_date"
    fi
  fi
  unset _program _version _verbose _sha _long_sha _date
}
warn() {
  case "${TERM:-}" in
    *term | alacritty | rxvt | screen | screen-* | tmux | tmux-* | xterm-*)
      printf -- "\033[1;31;40m!!! \033[1;37;40m%s\033[0m\n" "$1"
      ;;
    *)
      printf -- "!!! %s\n" "$1"
      ;;
  esac
}
section() {
  case "${TERM:-}" in
    *term | alacritty | rxvt | screen | screen-* | tmux | tmux-* | xterm-*)
      printf -- "\033[1;36;40m--- \033[1;37;40m%s\033[0m\n" "$1"
      ;;
    *)
      printf -- "--- %s\n" "$1"
      ;;
  esac
}
setup_cleanup_directories() {
  if [ -z "${__CLEANUP_DIRECTORIES__:-}" ]; then
    __CLEANUP_DIRECTORIES__="$(mktemp_file)"
    if [ -z "$__CLEANUP_DIRECTORIES__" ]; then
      return 1
    fi
    export __CLEANUP_DIRECTORIES__
  fi
}
setup_cleanup_files() {
  if [ -z "${__CLEANUP_FILES__:-}" ]; then
    __CLEANUP_FILES__="$(mktemp_file)"
    if [ -z "$__CLEANUP_FILES__" ]; then
      return 1
    fi
    export __CLEANUP_FILES__
  fi
}
setup_cleanups() {
  setup_cleanup_directories
  setup_cleanup_files
}
setup_traps() {
  local _sig
  for _sig in HUP INT QUIT ALRM TERM; do
    trap "
      $1
      trap - $_sig EXIT
      kill -s $_sig "'"$$"' "$_sig"
  done
  if [ -n "${ZSH_VERSION:-}" ]; then
    eval "zshexit() { eval '$1'; }"
  else
    # shellcheck disable=SC2064
    trap "$1" EXIT
  fi
  unset _sig
}
trap_cleanup_directories() {
  set +e
  if [ -n "${__CLEANUP_DIRECTORIES__:-}" ] \
    && [ -f "$__CLEANUP_DIRECTORIES__" ]; then
    local _dir
    while read -r _dir; do
      rm -rf "$_dir"
    done <"$__CLEANUP_DIRECTORIES__"
    unset _dir
    rm -f "$__CLEANUP_DIRECTORIES__"
  fi
}
check_cmd() {
  if ! command -v "$1" >/dev/null 2>&1; then
    return 1
  fi
}
cleanup_directory() {
  setup_cleanup_directories
  echo "$1" >>"$__CLEANUP_DIRECTORIES__"
}
cleanup_file() {
  setup_cleanup_files
  echo "$1" >>"$__CLEANUP_FILES__"
}
die() {
  case "${TERM:-}" in
    *term | alacritty | rxvt | screen | screen-* | tmux | tmux-* | xterm-*)
      printf -- "\n\033[1;31;40mxxx \033[1;37;40m%s\033[0m\n\n" "$1" >&2
      ;;
    *)
      printf -- "\nxxx %s\n\n" "$1" >&2
      ;;
  esac
  exit 1
}
download() {
  local _url _dst _code _orig_flags
  _url="$1"
  _dst="$2"
  need_cmd sed
  if check_cmd curl; then
    info "Downloading $_url to $_dst (curl)"
    _orig_flags="$-"
    set +e
    curl -sSfL "$_url" -o "$_dst"
    _code="$?"
    set "-$(echo "$_orig_flags" | sed s/s//g)"
    if [ $_code -eq 0 ]; then
      unset _url _dst _code _orig_flags
      return 0
    else
      local _e
      _e="curl failed to download file, perhaps curl doesn't have"
      _e="$_e SSL support and/or no CA certificates are present?"
      warn "$_e"
      unset _e
    fi
  fi
  if check_cmd wget; then
    info "Downloading $_url to $_dst (wget)"
    _orig_flags="$-"
    set +e
    wget -q -O "$_dst" "$_url"
    _code="$?"
    set "-$(echo "$_orig_flags" | sed s/s//g)"
    if [ $_code -eq 0 ]; then
      unset _url _dst _code _orig_flags
      return 0
    else
      local _e
      _e="wget failed to download file, perhaps wget doesn't have"
      _e="$_e SSL support and/or no CA certificates are present?"
      warn "$_e"
      unset _e
    fi
  fi
  if check_cmd ftp; then
    info "Downloading $_url to $_dst (ftp)"
    _orig_flags="$-"
    set +e
    ftp -o "$_dst" "$_url"
    _code="$?"
    set "-$(echo "$_orig_flags" | sed s/s//g)"
    if [ $_code -eq 0 ]; then
      unset _url _dst _code _orig_flags
      return 0
    else
      local _e
      _e="ftp failed to download file, perhaps ftp doesn't have"
      _e="$_e SSL support and/or no CA certificates are present?"
      warn "$_e"
      unset _e
    fi
  fi
  unset _url _dst _code _orig_flags
  warn "Downloading requires SSL-enabled 'curl', 'wget', or 'ftp' on PATH"
  return 1
}
indent() {
  local _ecfile _ec _orig_flags
  need_cmd cat
  need_cmd rm
  need_cmd sed
  _ecfile="$(mktemp_file)"
  _orig_flags="$-"
  set +e
  {
    "$@" 2>&1
    echo "$?" >"$_ecfile"
  } | sed 's/^/       /'
  set "-$(echo "$_orig_flags" | sed s/s//g)"
  _ec="$(cat "$_ecfile")"
  rm -f "$_ecfile"
  unset _ecfile _orig_flags
  return "${_ec:-5}"
}
info() {
  case "${TERM:-}" in
    *term | alacritty | rxvt | screen | screen-* | tmux | tmux-* | xterm-*)
      printf -- "\033[1;36;40m  - \033[1;37;40m%s\033[0m\n" "$1"
      ;;
    *)
      printf -- "  - %s\n" "$1"
      ;;
  esac
}
info_end() {
  case "${TERM:-}" in
    *term | alacritty | rxvt | screen | screen-* | tmux | tmux-* | xterm-*)
      printf -- "\033[1;37;40m%s\033[0m\n" "done."
      ;;
    *)
      printf -- "%s\n" "done."
      ;;
  esac
}
info_start() {
  case "${TERM:-}" in
    *term | alacritty | rxvt | screen | screen-* | tmux | tmux-* | xterm-*)
      printf -- "\033[1;36;40m  - \033[1;37;40m%s ... \033[0m" "$1"
      ;;
    *)
      printf -- "  - %s ... " "$1"
      ;;
  esac
}

# END: libsh.sh

main "$@"


================================================
FILE: release.toml
================================================
pre-release-replacements = [
  # Update CHANGELOG.md
  { file="CHANGELOG.md", prerelease=true, search="[Uu]nreleased", replace="{{version}}" },
  { file="CHANGELOG.md", prerelease=true, search="\\.\\.\\.HEAD", replace="...{{tag_name}}" },
  { file="CHANGELOG.md", prerelease=true, search="ReleaseDate", replace="{{date}}" },
  { file="CHANGELOG.md", prerelease=true, search="<!-- next-header -->", replace="<!-- next-header -->\n\n## [Unreleased] - ReleaseDate" },
  { file="CHANGELOG.md", prerelease=true, search="<!-- next-url -->", replace="<!-- next-url -->\n\n[unreleased]: https://github.com/fnichol/{{crate_name}}/compare/{{tag_name}}...HEAD" },
  # Update html_root_url in lib.rs
  { file = "src/lib.rs", search = "\"https://docs.rs/[^\"]+\"", replace = "\"https://docs.rs/{{crate_name}}/{{version}}\"", prerelease = true },
  # Update dependencies usage of the form `{{crate_name}} = "{{version}}" (if present)
  { file = "src/lib.rs", search = "(?P<deps>//! \\[(dev-|build-)?dependencies\\])\n(?P<crate_name>//! [[[:alnum:]]_-]+) = \"[^\"]+\"\n", replace = "$deps\n$crate_name = \"{{version}}\"\n", min = 0, prerelease = true },
  # Update dependencies usage of the form `{{crate_name}} = { version = "{{version}}", ... } (if present)
  { file = "src/lib.rs", search = "(?P<deps>//! \\[(dev-|build-)?dependencies\\])\n(?P<crate_name>//! [[[:alnum:]]_-]+) = \\{(?P<prever>.+)(?P<ver>version = )\"[^\"]+\"(?P<postver>.+)\\}\n", replace = "$deps\n$crate_name = {${prever}version = \"{{version}}\"$postver}\n", min = 0, prerelease = true },
]
pre-release-hook = ["cargo", "make", "release-pre-release-hook"]
pre-release-commit-message = "release: {{crate_name}} {{version}}"

tag-message = "release: {{crate_name}} {{version}}"

dev-version-ext = "dev"

post-release-replacements = [
  # Update html_root_url in lib.rs
  { file = "src/lib.rs", search = "\"https://docs.rs/[^\"]+\"", replace = "\"https://docs.rs/{{crate_name}}/{{next_version}}\"", prerelease = true },
]
post-release-commit-message = "chore: start next iteration {{next_version}}"

disable-publish = true
disable-push = true


================================================
FILE: src/bin/names.rs
================================================
use names::Generator;

fn main() {
    let args = cli::parse();

    Generator::with_naming(args.naming())
        .take(args.amount)
        .for_each(|name| println!("{}", name));
}

mod cli {
    use clap::Parser;
    use names::Name;

    const AUTHOR: &str = concat!(env!("CARGO_PKG_AUTHORS"), "\n\n");
    const VERSION: &str = env!("CARGO_PKG_VERSION");

    pub(crate) fn parse() -> Args {
        Args::parse()
    }

    /// A random name generator with results like "delirious-pail"
    #[derive(Parser, Debug)]
    #[clap(author = AUTHOR, version = VERSION)]
    pub(crate) struct Args {
        /// Adds a random number to the name(s)
        #[clap(short, long)]
        pub(crate) number: bool,

        /// Number of names to generate
        #[clap(default_value = "1", rename_all = "screaming_snake_case")]
        pub(crate) amount: usize,
    }

    impl Args {
        pub(crate) fn naming(&self) -> Name {
            if self.number {
                Name::Numbered
            } else {
                Name::default()
            }
        }
    }
}


================================================
FILE: src/lib.rs
================================================
//! This crate provides a generate that constructs random name strings suitable
//! for use in container instances, project names, application instances, etc.
//!
//! The name `Generator` implements the `Iterator` trait so it can be used with
//! adapters, consumers, and in loops.
//!
//! ## Usage
//!
//! This crate is [on crates.io](https://crates.io/crates/names) and can be
//! used by adding `names` to your dependencies in your project's `Cargo.toml`
//! file:
//!
//! ```toml
//! [dependencies]
//! names = { version = "0.14.0", default-features = false }
//! ```
//! ## Examples
//!
//! ### Example: painless defaults
//!
//! The easiest way to get started is to use the default `Generator` to return
//! a name:
//!
//! ```
//! use names::Generator;
//!
//! let mut generator = Generator::default();
//! println!("Your project is: {}", generator.next().unwrap());
//! // #=> "Your project is: rusty-nail"
//! ```
//!
//! If more randomness is required, you can generate a name with a trailing
//! 4-digit number:
//!
//! ```
//! use names::{Generator, Name};
//!
//! let mut generator = Generator::with_naming(Name::Numbered);
//! println!("Your project is: {}", generator.next().unwrap());
//! // #=> "Your project is: pushy-pencil-5602"
//! ```
//!
//! ### Example: with custom dictionaries
//!
//! If you would rather supply your own custom adjective and noun word lists,
//! you can provide your own by supplying 2 string slices. For example,
//! this returns only one result:
//!
//! ```
//! use names::{Generator, Name};
//!
//! let adjectives = &["imaginary"];
//! let nouns = &["roll"];
//! let mut generator = Generator::new(adjectives, nouns, Name::default());
//!
//! assert_eq!("imaginary-roll", generator.next().unwrap());
//! ```

#![doc(html_root_url = "https://docs.rs/names/0.14.1-dev")]
#![deny(missing_docs)]

use rand::{rngs::ThreadRng, seq::SliceRandom, Rng};

/// List of English adjective words
pub const ADJECTIVES: &[&str] = &include!(concat!(env!("OUT_DIR"), "/adjectives.rs"));

/// List of English noun words
pub const NOUNS: &[&str] = &include!(concat!(env!("OUT_DIR"), "/nouns.rs"));

/// A naming strategy for the `Generator`
pub enum Name {
    /// This represents a plain naming strategy of the form `"ADJECTIVE-NOUN"`
    Plain,
    /// This represents a naming strategy with a random number appended to the
    /// end, of the form `"ADJECTIVE-NOUN-NUMBER"`
    Numbered,
}

impl Default for Name {
    fn default() -> Self {
        Name::Plain
    }
}

/// A random name generator which combines an adjective, a noun, and an
/// optional number
///
/// A `Generator` takes a slice of adjective and noun words strings and has
/// a naming strategy (with or without a number appended).
pub struct Generator<'a> {
    adjectives: &'a [&'a str],
    nouns: &'a [&'a str],
    naming: Name,
    rng: ThreadRng,
}

impl<'a> Generator<'a> {
    /// Constructs a new `Generator<'a>`
    ///
    /// # Examples
    ///
    /// ```
    /// use names::{Generator, Name};
    ///
    /// let adjectives = &["sassy"];
    /// let nouns = &["clocks"];
    /// let naming = Name::Plain;
    ///
    /// let mut generator = Generator::new(adjectives, nouns, naming);
    ///
    /// assert_eq!("sassy-clocks", generator.next().unwrap());
    /// ```
    pub fn new(adjectives: &'a [&'a str], nouns: &'a [&'a str], naming: Name) -> Self {
        Generator {
            adjectives,
            nouns,
            naming,
            rng: ThreadRng::default(),
        }
    }

    /// Construct and returns a default `Generator<'a>` containing a large
    /// collection of adjectives and nouns
    ///
    /// ```
    /// use names::{Generator, Name};
    ///
    /// let mut generator = Generator::with_naming(Name::Plain);
    ///
    /// println!("My new name is: {}", generator.next().unwrap());
    /// ```
    pub fn with_naming(naming: Name) -> Self {
        Generator::new(ADJECTIVES, NOUNS, naming)
    }
}

impl<'a> Default for Generator<'a> {
    fn default() -> Self {
        Generator::new(ADJECTIVES, NOUNS, Name::default())
    }
}

impl<'a> Iterator for Generator<'a> {
    type Item = String;

    fn next(&mut self) -> Option<String> {
        let adj = self.adjectives.choose(&mut self.rng).unwrap();
        let noun = self.nouns.choose(&mut self.rng).unwrap();

        Some(match self.naming {
            Name::Plain => format!("{}-{}", adj, noun),
            Name::Numbered => format!("{}-{}-{:04}", adj, noun, rand_num(&mut self.rng)),
        })
    }
}

fn rand_num(rng: &mut ThreadRng) -> u16 {
    rng.gen_range(1..10000)
}


================================================
FILE: tests/version-numbers.rs
================================================
#[test]
fn test_readme_deps() {
    version_sync::assert_markdown_deps_updated!("README.md");

    // TODO(fnichol): Ideally a code block updating tool can keep this up to date
    // version_sync::assert_contains_regex!("README.md", r#"{name} --help$\n^{name} {version}$"#);
}

#[test]
fn test_html_root_url() {
    version_sync::assert_html_root_url_updated!("src/lib.rs");
}


================================================
FILE: vendor/cargo-make/Makefile.common.toml
================================================
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"

[config]
skip_core_tasks = true

[tasks.default]
description = "Builds, tests, & checks the project"
dependencies = [
  "clean",
  "build",
  "test",
  "check",
]

[tasks.build]
description = "Builds all the targets"
category = "Build"
dependencies = [
  "build-lib",
  "build-bin",
]

[tasks.build-bin]
description = "Builds the binaries"
category = "Build"
command = "cargo"
args = ["build", "--verbose", "--bins", "${@}"]

[tasks.build-lib]
description = "Builds the library"
category = "Build"
command = "cargo"
args = ["build", "--verbose", "--no-default-features", "--lib", "${@}"]

[tasks.build-release]
description = "Builds a release build"
category = "Build"
command = "cargo"
args = ["build", "--verbose", "--release", "${@}"]

[tasks.check]
description = "Checks all linting, formatting, & other rules"
category = "Check"
dependencies = [
  "check-lint",
  "check-format",
]

[tasks.check-format]
description = "Checks all formatting"
category = "Check"
dependencies = [
  "rustfmt-check",
  # "readme-check",
]

[tasks.check-lint]
description = "Checks all linting"
category = "Check"
dependencies = [
  "clippy",
]

[tasks.clean]
description = "Cleans the project"
command = "cargo"
args = ["clean", "${@}"]

[tasks.clippy]
description = "Runs Clippy for linting"
category = "Check"
dependencies = ["install-clippy"]
command = "cargo"
args = ["clippy", "--all-targets", "--all-features", "--", "-D", "warnings"]

[tasks.help]
description = "Displays this help"
command = "cargo"
args = ["make", "--list-all-steps"]

[tasks.prepush]
description = "Runs all checks/tests required before pushing commits"
dependencies = [
  "check",
  "test-no-args",
]

[tasks.release-prepare]
description = "Prepares for a release"
category = "Release"
dependencies = [
  "prepush",
  "release-invoke-cargo-release",
  "release-push-branch",
]

[tasks.release-invoke-cargo-release]
description = "Invokes cargo release"
category = "Release"
dependencies = ["install-cargo-release"]
command = "cargo"
args = ["release", "${@}"]

[tasks.release-pre-release-hook]
description = "Release preparation tasks"
category = "Release"
dependencies = [
  "release-create-branch",
  "readme",
  "verify-version-numbers",
]

[tasks.release-create-branch]
description = "Create a Git release branch"
category = "Release"
command = "git"
args = ["checkout", "-b", "release-${NEW_VERSION}"]

[tasks.release-push-branch]
description = "Pushes the current Git branch to the origin remote"
category = "Release"
command = "git"
args = ["push", "origin", "HEAD"]

[tasks.readme]
description = "Generates, updates, & formats the README"
category = "Readme"
dependencies = [
  "readme-generate",
  "readme-toc",
  "readme-format",
]

[tasks.readme-check]
description = "Checks the README freshness & formatting"
category = "Check"
dependencies = [
  "readme-toc-check",
  "readme-format-check",
]

[tasks.readme-generate]
description = "Generates & updates the README"
category = "Readme"
dependencies = ["install-cargo-readme"]
command = "cargo"
args = ["readme", "--output", "README.md"]

[tasks.readme-format]
description = "Formats the README"
category = "Readme"
dependencies = ["install-prettier"]
command = "prettier"
args = ["--write", "README.md"]

[tasks.readme-format-check]
description = "Checks the README formatting"
category = "Check"
dependencies = ["install-prettier"]
command = "prettier"
args = ["--check", "README.md"]

[tasks.readme-toc]
description = "Updates the README table of contents"
category = "Readme"
dependencies = ["install-mtoc"]
command = "mtoc"
args = ["--in-place", "--format", "dashes", "README.md"]

[tasks.readme-toc-check]
description = "Checks the README table of contents"
category = "Check"
dependencies = ["install-mtoc"]
command = "mtoc"
args = ["--check", "--format", "dashes", "README.md"]

[tasks.rustfmt]
description = "Runs Rustfmt to format code"
category = "Format"
dependencies = ["install-rustfmt"]
command = "cargo"
args = ["fmt", "--verbose", "--"]

[tasks.rustfmt-check]
description = "Runs Rustfmt to check code formatting"
category = "Check"
dependencies = ["install-rustfmt"]
command = "cargo"
args = ["fmt", "--verbose", "--", "--check"]

[tasks.test]
description = "Runs all the tests"
category = "Test"
dependencies = [
  "test-lib",
  "test-bin",
]

[tasks.test-no-args]
private = true
dependencies = [
  "test-lib-no-args",
  "test-bin-no-args",
]

[tasks.test-lib]
description = "Runs all the library tests"
category = "Test"
command = "cargo"
args = ["test", "--no-default-features", "--lib", "${@}"]

[tasks.test-lib-no-args]
private = true
command = "cargo"
args = ["test", "--no-default-features", "--lib"]

[tasks.test-bin]
description = "Runs all the binary tests"
category = "Test"
command = "cargo"
args = ["test", "--bins", "${@}"]

[tasks.test-bin-no-args]
private = true
command = "cargo"
args = ["test", "--bins"]

[tasks.verify-version-numbers]
command = "cargo"
category = "Test"
args = ["test", "--test", "version-numbers"]

[tasks.install-cargo-readme]
private = true
[tasks.install-cargo-readme.install_crate]
crate_name = "cargo-readme"
binary = "cargo-readme"
test_arg = "--help"

[tasks.install-cargo-release]
private = true
[tasks.install-cargo-release.install_crate]
crate_name = "cargo-release"
binary = "cargo-release"
test_arg = "--help"

[tasks.install-clippy]
private = true
[tasks.install-clippy.install_crate]
rustup_component_name = "clippy"
binary = "cargo-clippy"
test_arg = "--help"

[tasks.install-mtoc]
private = true
[tasks.install-mtoc.install_crate]
crate_name = "mtoc"
binary = "mtoc"
test_arg = "--help"

[tasks.install-prettier]
private = true
install_script = '''
  if ! command -v prettier; then
    npm install --global prettier
  fi
'''
[tasks.install-prettier.windows]
install_script = '''
  if (-Not (Get-Command prettier -ErrorAction SilentlyContinue)) {
    npm install --global prettier
  }
'''

[tasks.install-rustfmt]
private = true
[tasks.install-rustfmt.install_crate]
rustup_component_name = "rustfmt"
binary = "rustfmt"
test_arg = "--help"
Download .txt
gitextract__nxd32rv/

├── .ci/
│   ├── build-cargo-make.ps1
│   ├── build-cargo-make.sh
│   ├── build-checksums.ps1
│   ├── build-checksums.sh
│   ├── build-docker-image.sh
│   ├── cirrus-release.sh
│   ├── install-cargo-make.ps1
│   ├── install-cargo-make.sh
│   └── names.manifest.txt
├── .cirrus.yml
├── .gitattributes
├── .github/
│   └── bors.toml
├── .gitignore
├── .prettierrc.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── Cargo.toml
├── LICENSE.txt
├── Makefile.toml
├── README.md
├── README.tpl
├── build.rs
├── data/
│   ├── adjectives.txt
│   └── nouns.txt
├── docs/
│   └── install.sh
├── release.toml
├── src/
│   ├── bin/
│   │   └── names.rs
│   └── lib.rs
├── tests/
│   └── version-numbers.rs
└── vendor/
    └── cargo-make/
        └── Makefile.common.toml
Download .txt
SYMBOL INDEX (22 symbols across 4 files)

FILE: build.rs
  function main (line 6) | fn main() -> Result<(), Box<dyn std::error::Error>> {
  function generate (line 21) | fn generate(src_path: impl AsRef<Path>, dst_path: impl AsRef<Path>) -> i...
  function update_version_if_nightly (line 32) | fn update_version_if_nightly() {

FILE: src/bin/names.rs
  function main (line 3) | fn main() {
  constant AUTHOR (line 15) | const AUTHOR: &str = concat!(env!("CARGO_PKG_AUTHORS"), "\n\n");
  constant VERSION (line 16) | const VERSION: &str = env!("CARGO_PKG_VERSION");
  function parse (line 18) | pub(crate) fn parse() -> Args {
  type Args (line 25) | pub(crate) struct Args {
    method naming (line 36) | pub(crate) fn naming(&self) -> Name {

FILE: src/lib.rs
  constant ADJECTIVES (line 65) | pub const ADJECTIVES: &[&str] = &include!(concat!(env!("OUT_DIR"), "/adj...
  constant NOUNS (line 68) | pub const NOUNS: &[&str] = &include!(concat!(env!("OUT_DIR"), "/nouns.rs...
  type Name (line 71) | pub enum Name {
  method default (line 80) | fn default() -> Self {
  type Generator (line 90) | pub struct Generator<'a> {
  function new (line 113) | pub fn new(adjectives: &'a [&'a str], nouns: &'a [&'a str], naming: Name...
  function with_naming (line 132) | pub fn with_naming(naming: Name) -> Self {
  method default (line 138) | fn default() -> Self {
  type Item (line 144) | type Item = String;
  method next (line 146) | fn next(&mut self) -> Option<String> {
  function rand_num (line 157) | fn rand_num(rng: &mut ThreadRng) -> u16 {

FILE: tests/version-numbers.rs
  function test_readme_deps (line 2) | fn test_readme_deps() {
  function test_html_root_url (line 10) | fn test_html_root_url() {
Condensed preview — 30 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (135K chars).
[
  {
    "path": ".ci/build-cargo-make.ps1",
    "chars": 1484,
    "preview": "#!/usr/bin/env powershell\n\n<#\n.SYNOPSIS\nBuilds cargo-make into a dedicated directory for caching\n\n.DESCRIPTION\nThe scrip"
  },
  {
    "path": ".ci/build-cargo-make.sh",
    "chars": 1791,
    "preview": "#!/usr/bin/env sh\n# shellcheck shell=sh disable=SC2039\n\nprint_usage() {\n  local program=\"$1\"\n\n  echo \"$program\n\n    Buil"
  },
  {
    "path": ".ci/build-checksums.ps1",
    "chars": 941,
    "preview": "#!/usr/bin/env powershell\n\n<#\n.SYNOPSIS\nGenerates checksum digests for a file\n\n.DESCRIPTION\nThe script generates a SHA25"
  },
  {
    "path": ".ci/build-checksums.sh",
    "chars": 2833,
    "preview": "#!/usr/bin/env sh\n# shellcheck shell=sh disable=SC2039\n\nprint_usage() {\n  local program=\"$1\"\n\n  echo \"$program\n\n    Gene"
  },
  {
    "path": ".ci/build-docker-image.sh",
    "chars": 5257,
    "preview": "#!/usr/bin/env sh\n# shellcheck shell=sh disable=SC2039\n\nprint_usage() {\n  local program=\"$1\"\n\n  echo \"$program\n\n    Buil"
  },
  {
    "path": ".ci/cirrus-release.sh",
    "chars": 7438,
    "preview": "#!/usr/bin/env sh\n# shellcheck disable=SC3043\n\nmain() {\n  set -eu\n  if [ -n \"${DEBUG:-}\" ]; then set -v; fi\n  if [ -n \"$"
  },
  {
    "path": ".ci/install-cargo-make.ps1",
    "chars": 2304,
    "preview": "#!/usr/bin/env powershell\n\n<#\n.SYNOPSIS\nInstalls cargo-make\n\n.DESCRIPTION\nThe script will download and extract a version"
  },
  {
    "path": ".ci/install-cargo-make.sh",
    "chars": 2752,
    "preview": "#!/usr/bin/env sh\n# shellcheck shell=sh disable=SC2039\n\nprint_usage() {\n  local program=\"$1\"\n\n  echo \"$program\n\n    Inst"
  },
  {
    "path": ".ci/names.manifest.txt",
    "chars": 451,
    "preview": "darwin-x86_64\tnames-x86_64-apple-darwin.zip\nfreebsd-x86_64\tnames-x86_64-unknown-freebsd.tar.gz\nlinux-aarch64\tnames-aarch"
  },
  {
    "path": ".cirrus.yml",
    "chars": 14635,
    "preview": "---\n# BEGIN: cirrus-anchors.yml\nanchors:\n  - &install_cargo_make_unix\n    install_cargo_make_script: ./.ci/install-cargo"
  },
  {
    "path": ".gitattributes",
    "chars": 54,
    "preview": ".ci/** linguist-vendored\n.github/** linguist-vendored\n"
  },
  {
    "path": ".github/bors.toml",
    "chars": 60,
    "preview": "status = [\"ci-finished\"]\ncommit_title = \"merge: ${PR_REFS}\"\n"
  },
  {
    "path": ".gitignore",
    "chars": 8,
    "preview": "target/\n"
  },
  {
    "path": ".prettierrc.yml",
    "chars": 18,
    "preview": "proseWrap: always\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 2410,
    "preview": "# Changelog\n\n<!-- next-header -->\n\n## [Unreleased] - ReleaseDate\n\n## [0.14.0] - 2022-06-28\n\n### Changed\n\n- upgrade to `r"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 3367,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
  },
  {
    "path": "Cargo.toml",
    "chars": 965,
    "preview": "[package]\nname = \"names\"\nversion = \"0.14.1-dev\"\nauthors = [\"Fletcher Nichol <fnichol@nichol.ca>\"]\nedition = \"2018\"\nlicen"
  },
  {
    "path": "LICENSE.txt",
    "chars": 1059,
    "preview": "Copyright (c) 2015 Fletcher Nichol\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this"
  },
  {
    "path": "Makefile.toml",
    "chars": 335,
    "preview": "extend = \"./vendor/cargo-make/Makefile.common.toml\"\n\n[tasks.install-sh-upgrade-libsh]\ndescription = \"Upgrades the insert"
  },
  {
    "path": "README.md",
    "chars": 15796,
    "preview": "<h1 align=\"center\">\n  <br/>\n  names\n  <br/>\n</h1>\n\n<h4 align=\"center\">\n  Random name generator for Rust\n</h4>\n\n|        "
  },
  {
    "path": "README.tpl",
    "chars": 13586,
    "preview": "<h1 align=\"center\">\n  <br/>\n  {{crate}}\n  <br/>\n</h1>\n\n<h4 align=\"center\">\n  Random name generator for Rust\n</h4>\n\n|    "
  },
  {
    "path": "build.rs",
    "chars": 1275,
    "preview": "use std::env;\nuse std::fs::File;\nuse std::io::{self, BufRead, BufReader, BufWriter, Write};\nuse std::path::Path;\n\nfn mai"
  },
  {
    "path": "data/adjectives.txt",
    "chars": 9044,
    "preview": "aback\nabaft\nabandoned\nabashed\naberrant\nabhorrent\nabiding\nabject\nablaze\nable\nabnormal\naboard\naboriginal\nabortive\naboundin"
  },
  {
    "path": "data/nouns.txt",
    "chars": 6340,
    "preview": "able\naccount\nachieve\nachiever\nacoustics\nact\naction\nactivity\nactor\naddition\nadjustment\nadvertisement\nadvice\naftermath\naft"
  },
  {
    "path": "docs/install.sh",
    "chars": 16252,
    "preview": "#!/usr/bin/env sh\n# shellcheck shell=sh disable=SC3043\n\nprint_usage() {\n  local program version author default_dest defa"
  },
  {
    "path": "release.toml",
    "chars": 2098,
    "preview": "pre-release-replacements = [\n  # Update CHANGELOG.md\n  { file=\"CHANGELOG.md\", prerelease=true, search=\"[Uu]nreleased\", r"
  },
  {
    "path": "src/bin/names.rs",
    "chars": 1073,
    "preview": "use names::Generator;\n\nfn main() {\n    let args = cli::parse();\n\n    Generator::with_naming(args.naming())\n        .take"
  },
  {
    "path": "src/lib.rs",
    "chars": 4588,
    "preview": "//! This crate provides a generate that constructs random name strings suitable\n//! for use in container instances, proj"
  },
  {
    "path": "tests/version-numbers.rs",
    "chars": 378,
    "preview": "#[test]\nfn test_readme_deps() {\n    version_sync::assert_markdown_deps_updated!(\"README.md\");\n\n    // TODO(fnichol): Ide"
  },
  {
    "path": "vendor/cargo-make/Makefile.common.toml",
    "chars": 6088,
    "preview": "[env]\nCARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = \"true\"\n\n[config]\nskip_core_tasks = true\n\n[tasks.default]\ndescription = \"Bui"
  }
]

About this extraction

This page contains the full source code of the fnichol/names GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 30 files (121.8 KB), approximately 37.2k tokens, and a symbol index with 22 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!