names-0.14.0/.cargo_vcs_info.json0000644000000001360000000000100122210ustar { "git": { "sha1": "8f09d5bf9860582c485b5856cbb325642d3e82c2" }, "path_in_vcs": "" }names-0.14.0/.ci/build-cargo-make.ps1000064400000000000000000000027140072674642500152460ustar 00000000000000#!/usr/bin/env powershell <# .SYNOPSIS Builds cargo-make into a dedicated directory for caching .DESCRIPTION The script will run `cargo install ` 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 names-0.14.0/.ci/build-cargo-make.sh000075500000000000000000000033770072674642500151660ustar 00000000000000#!/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] [--] FLAGS: -h, --help Prints help information ARGS: 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 "$@" names-0.14.0/.ci/build-checksums.ps1000064400000000000000000000016550072674642500152300ustar 00000000000000#!/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" names-0.14.0/.ci/build-checksums.sh000075500000000000000000000054210072674642500151350ustar 00000000000000#!/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] [--] FLAGS: -h, --help Prints help information ARGS: 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 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 "$@" names-0.14.0/.ci/build-docker-image.sh000075500000000000000000000122110072674642500154720ustar 00000000000000#!/usr/bin/env sh # shellcheck shell=sh disable=SC2039 print_usage() { local program="$1" echo "$program Builds a Docker image USAGE: $program [FLAGS] [--] FLAGS: -h, --help Prints help information ARGS: Tarball archive [example: names-x86_64-linux-musl.tar.gz] Author names [example: Jane Doe Name of the program [example: names] Name of Docker Hub image [example: jdoe/names] License for project [example: MPL-2.0] Name of GitHub repository [example: jdoe/names-rs] 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 argument" fi img="$1" shift if [ -z "${1:-}" ]; then print_usage "$program" >&2 die "missing argument" fi version="$1" shift if [ -z "${1:-}" ]; then print_usage "$program" >&2 die "missing argument" fi repo="$1" shift if [ -z "${1:-}" ]; then print_usage "$program" >&2 die "missing argument" fi author="$1" shift if [ -z "${1:-}" ]; then print_usage "$program" >&2 die "missing argument" fi license="$1" shift if [ -z "${1:-}" ]; then print_usage "$program" >&2 die "missing argument" fi bin="$1" shift if [ -z "${1:-}" ]; then print_usage "$program" >&2 die "missing 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 "$@" names-0.14.0/.ci/cirrus-release.sh000075500000000000000000000164160072674642500150060ustar 00000000000000#!/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 && (/^## \[/ || /^$/) { 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 /^$/ { 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" \ &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; then echo "!!! Failed to find a release for tag $tag" >&2 return 1 fi jq -r .upload_url /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 "$@" names-0.14.0/.ci/install-cargo-make.ps1000064400000000000000000000044000072674642500156070ustar 00000000000000#!/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 names-0.14.0/.ci/install-cargo-make.sh000075500000000000000000000053000072674642500155210ustar 00000000000000#!/usr/bin/env sh # shellcheck shell=sh disable=SC2039 print_usage() { local program="$1" echo "$program Installs cargo-make USAGE: $program [FLAGS] [--] [] FLAGS: -h, --help Prints help information --print-latest Prints the latest version of cargo-make ARGS: 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 "$@" names-0.14.0/.ci/names.manifest.txt000064400000000000000000000007030072674642500151630ustar 00000000000000darwin-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 names-0.14.0/.cirrus.yml000064400000000000000000000344530072674642500131620ustar 00000000000000--- # 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 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 names-0.14.0/.gitattributes000064400000000000000000000000660072674642500137360ustar 00000000000000.ci/** linguist-vendored .github/** linguist-vendored names-0.14.0/.github/bors.toml000064400000000000000000000000740072674642500142440ustar 00000000000000status = ["ci-finished"] commit_title = "merge: ${PR_REFS}" names-0.14.0/.gitignore000064400000000000000000000000100072674642500130200ustar 00000000000000target/ names-0.14.0/.prettierrc.yml000064400000000000000000000000220072674642500140170ustar 00000000000000proseWrap: always names-0.14.0/CHANGELOG.md000064400000000000000000000045520072674642500126600ustar 00000000000000# Changelog ## [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. [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 names-0.14.0/CODE_OF_CONDUCT.md000064400000000000000000000064470072674642500136530ustar 00000000000000# 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 names-0.14.0/Cargo.lock0000644000000266100000000000100102010ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", "winapi", ] [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" version = "3.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced1892c55c910c1219e98d6fc8d71f6bddba7905866ce740066d8bfea859312" dependencies = [ "atty", "bitflags", "clap_derive", "indexmap", "lazy_static", "os_str_bytes", "strsim", "termcolor", "textwrap", ] [[package]] name = "clap_derive" version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da95d038ede1a964ce99f49cbe27a7fb538d1da595e4b4f70b8c8f338d17bf16" dependencies = [ "heck", "proc-macro-error", "proc-macro2", "quote", "syn", ] [[package]] name = "form_urlencoded" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding", ] [[package]] name = "getrandom" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" dependencies = [ "cfg-if", "libc", "wasi", ] [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "idna" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", "hashbrown", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" [[package]] name = "matches" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "names" version = "0.14.0" dependencies = [ "clap", "rand", "version-sync", ] [[package]] name = "os_str_bytes" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" dependencies = [ "memchr", ] [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "ppv-lite86" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro-error" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", "syn", "version_check", ] [[package]] name = "proc-macro-error-attr" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", "version_check", ] [[package]] name = "proc-macro2" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] name = "pulldown-cmark" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" dependencies = [ "bitflags", "memchr", "unicase", ] [[package]] name = "quote" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", "rand_core", ] [[package]] name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", ] [[package]] name = "rand_core" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ "getrandom", ] [[package]] name = "regex" version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "semver" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" [[package]] name = "serde" version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] [[package]] name = "termcolor" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "textwrap" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "tinyvec" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] [[package]] name = "unicase" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ "version_check", ] [[package]] name = "unicode-bidi" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-xid" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "url" version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", "matches", "percent-encoding", ] [[package]] name = "version-sync" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d0801cec07737d88cb900e6419f6f68733867f90b3faaa837e84692e101bf0" dependencies = [ "proc-macro2", "pulldown-cmark", "regex", "semver", "syn", "toml", "url", ] [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ "winapi", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" names-0.14.0/Cargo.toml0000644000000023460000000000100102240ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "names" version = "0.14.0" authors = ["Fletcher Nichol "] description = """ A random name generator with names suitable for use in container instances, project names, application instances, etc. """ homepage = "https://github.com/fnichol/names" documentation = "https://docs.rs/names" readme = "README.md" keywords = [ "name", "random", ] categories = ["command-line-utilities"] license = "MIT" repository = "https://github.com/fnichol/names" [package.metadata.docs.rs] no-default-features = true [dependencies.clap] version = "3.1.5" features = ["derive"] optional = true [dependencies.rand] version = "0.8.4" [dev-dependencies.version-sync] version = "0.9.1" [features] application = ["clap"] default = ["application"] names-0.14.0/Cargo.toml.orig000064400000000000000000000017010072674642500137270ustar 00000000000000[package] name = "names" version = "0.14.0" authors = ["Fletcher Nichol "] 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 names-0.14.0/LICENSE.txt000064400000000000000000000020430072674642500126630ustar 00000000000000Copyright (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. names-0.14.0/Makefile.toml000064400000000000000000000005170072674642500134560ustar 00000000000000extend = "./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 ''' names-0.14.0/README.md000064400000000000000000000366640072674642500123370ustar 00000000000000


names

Random name generator for Rust

| | | | ---------------: | ---------------------------------------------------------------------------------------- | | CI | [![CI Status][badge-ci-overall]][ci]
[![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] |
Table of Contents - [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)
## 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 A random name generator with results like "delirious-pail" USAGE: names [FLAGS] [AMOUNT] ARGS: 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 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] (). ## 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 names-0.14.0/README.tpl000064400000000000000000000324220072674642500125220ustar 00000000000000


{{crate}}

Random name generator for Rust

| | | | ---------------: | ---------------------------------------------------------------------------------------- | | CI | [![CI Status][badge-ci-overall]][ci]
[![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] |
Table of Contents
## 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 A random name generator with results like "delirious-pail" USAGE: names [FLAGS] [AMOUNT] ARGS: 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 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] (). ## 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 names-0.14.0/build.rs000064400000000000000000000023730072674642500125130ustar 00000000000000use std::env; use std::fs::File; use std::io::{self, BufRead, BufReader, BufWriter, Write}; use std::path::Path; fn main() -> Result<(), Box> { 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, dst_path: impl AsRef) -> 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, ); } } names-0.14.0/data/adjectives.txt000064400000000000000000000215240072674642500146400ustar 00000000000000aback 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 names-0.14.0/data/nouns.txt000064400000000000000000000143040072674642500136570ustar 00000000000000able 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 names-0.14.0/docs/install.sh000075500000000000000000000375740072674642500140160ustar 00000000000000#!/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= Destination directory for installation [default: $default_dest] -p, --platform= Platform type to install [examples: linux-x86_64, darwin-x86_64] [default: $default_platform] -r, --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 " 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 or the MIT license (see # , 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 # 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 "$@" names-0.14.0/install.sh000075500000000000000000000375740072674642500130660ustar 00000000000000#!/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= Destination directory for installation [default: $default_dest] -p, --platform= Platform type to install [examples: linux-x86_64, darwin-x86_64] [default: $default_platform] -r, --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 " 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 or the MIT license (see # , 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 # 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 "$@" names-0.14.0/release.toml000064400000000000000000000040620072674642500133600ustar 00000000000000pre-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="", replace="\n\n## [Unreleased] - ReleaseDate" }, { file="CHANGELOG.md", prerelease=true, search="", replace="\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//! \\[(dev-|build-)?dependencies\\])\n(?P//! [[[: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//! \\[(dev-|build-)?dependencies\\])\n(?P//! [[[:alnum:]]_-]+) = \\{(?P.+)(?Pversion = )\"[^\"]+\"(?P.+)\\}\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 names-0.14.0/src/bin/names.rs000064400000000000000000000020610072674642500140500ustar 00000000000000use 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() } } } } names-0.14.0/src/lib.rs000064400000000000000000000107500072674642500127470ustar 00000000000000//! 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.0")] #![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 { 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) } names-0.14.0/tests/version-numbers.rs000064400000000000000000000005720072674642500157130ustar 00000000000000#[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"); } names-0.14.0/vendor/cargo-make/Makefile.common.toml000064400000000000000000000137100072674642500202470ustar 00000000000000[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"