build(ariadne): vendor clap
This commit was merged in pull request #30.
This commit is contained in:
1
third_party/crates/anstyle-query-1.1.5/.cargo-checksum.json
vendored
Normal file
1
third_party/crates/anstyle-query-1.1.5/.cargo-checksum.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"$comment":"This file only protects against accidental modifications. It is not a security mechanism and does not protect against malicious changes.","files":{".cargo_vcs_info.json":"f59adccd8ea63dbc3aabdeb0520620695916f51f5306d1bb89f5008f7ad74724","Cargo.lock":"477d4354569c8a359d9056ab89ed2782a0a5cf609bb1f46e5da02c7059858e20","Cargo.toml":"478a0950938a0e6eea2bb824607c056c9ac517a45716841fe940b6e3488323b7","Cargo.toml.orig":"fab7c65e55f307103a392c58f7027a43c1b37918ae8f5e715dcb842140d693d0","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"6efb0476a1cc085077ed49357026d8c173bf33017278ef440f222fb9cbcb66e6","README.md":"9ed87a71a298ed4925210e66dd06c69f40600c1df97fd082d1763c2220c9f2f1","examples/query.rs":"fca5f5f48a20d282982a4de584dd79470375d89bf990447b0c6f24e842956297","src/lib.rs":"4ce20ab732c39c004a4d768567e4ad93758eaf402262b22ef009386950232c28","src/windows.rs":"76a8355df494a8152395377b7b9568615ea8fd9d6ab8ec998c6de1deb271697e"},"package":"40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"}
|
||||
6
third_party/crates/anstyle-query-1.1.5/.cargo_vcs_info.json
vendored
Normal file
6
third_party/crates/anstyle-query-1.1.5/.cargo_vcs_info.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"git": {
|
||||
"sha1": "368a8719474357f9d54be800b4163c9074561e37"
|
||||
},
|
||||
"path_in_vcs": "crates/anstyle-query"
|
||||
}
|
||||
122
third_party/crates/anstyle-query-1.1.5/BUILD.bazel
vendored
Normal file
122
third_party/crates/anstyle-query-1.1.5/BUILD.bazel
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
###############################################################################
|
||||
# @generated
|
||||
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
|
||||
# regenerate this file, run the following:
|
||||
#
|
||||
# bazel run @@//third_party:vendor_crates
|
||||
###############################################################################
|
||||
|
||||
load("@rules_rust//cargo:defs.bzl", "cargo_toml_env_vars")
|
||||
load("@rules_rust//rust:defs.bzl", "rust_library")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
cargo_toml_env_vars(
|
||||
name = "cargo_toml_env_vars",
|
||||
src = "Cargo.toml",
|
||||
)
|
||||
|
||||
rust_library(
|
||||
name = "anstyle_query",
|
||||
srcs = glob(
|
||||
include = ["**/*.rs"],
|
||||
allow_empty = False,
|
||||
),
|
||||
compile_data = glob(
|
||||
include = ["**"],
|
||||
allow_empty = True,
|
||||
exclude = [
|
||||
"**/* *",
|
||||
".tmp_git_root/**/*",
|
||||
"BUILD",
|
||||
"BUILD.bazel",
|
||||
"WORKSPACE",
|
||||
"WORKSPACE.bazel",
|
||||
],
|
||||
),
|
||||
crate_root = "src/lib.rs",
|
||||
edition = "2021",
|
||||
rustc_env_files = [
|
||||
":cargo_toml_env_vars",
|
||||
],
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-bazel",
|
||||
"crate-name=anstyle-query",
|
||||
"manual",
|
||||
"noclippy",
|
||||
"norustfmt",
|
||||
],
|
||||
target_compatible_with = select({
|
||||
"@rules_rust//rust/platform:aarch64-apple-darwin": [],
|
||||
"@rules_rust//rust/platform:aarch64-apple-ios": [],
|
||||
"@rules_rust//rust/platform:aarch64-apple-ios-macabi": [],
|
||||
"@rules_rust//rust/platform:aarch64-apple-ios-sim": [],
|
||||
"@rules_rust//rust/platform:aarch64-linux-android": [],
|
||||
"@rules_rust//rust/platform:aarch64-pc-windows-msvc": [],
|
||||
"@rules_rust//rust/platform:aarch64-unknown-fuchsia": [],
|
||||
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [],
|
||||
"@rules_rust//rust/platform:aarch64-unknown-none": [],
|
||||
"@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [],
|
||||
"@rules_rust//rust/platform:aarch64-unknown-uefi": [],
|
||||
"@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [],
|
||||
"@rules_rust//rust/platform:arm-unknown-linux-musleabi": [],
|
||||
"@rules_rust//rust/platform:armv7-linux-androideabi": [],
|
||||
"@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [],
|
||||
"@rules_rust//rust/platform:i686-apple-darwin": [],
|
||||
"@rules_rust//rust/platform:i686-linux-android": [],
|
||||
"@rules_rust//rust/platform:i686-pc-windows-msvc": [],
|
||||
"@rules_rust//rust/platform:i686-unknown-freebsd": [],
|
||||
"@rules_rust//rust/platform:i686-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:loongarch64-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:mips-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:riscv32imac-unknown-none-elf": [],
|
||||
"@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [],
|
||||
"@rules_rust//rust/platform:riscv64gc-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [],
|
||||
"@rules_rust//rust/platform:s390x-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:sparc64-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:sparc64-unknown-netbsd": [],
|
||||
"@rules_rust//rust/platform:sparc64-unknown-openbsd": [],
|
||||
"@rules_rust//rust/platform:thumbv6m-none-eabi": [],
|
||||
"@rules_rust//rust/platform:thumbv7em-none-eabi": [],
|
||||
"@rules_rust//rust/platform:thumbv7em-none-eabihf": [],
|
||||
"@rules_rust//rust/platform:thumbv7m-none-eabi": [],
|
||||
"@rules_rust//rust/platform:thumbv8m.main-none-eabi": [],
|
||||
"@rules_rust//rust/platform:thumbv8m.main-none-eabihf": [],
|
||||
"@rules_rust//rust/platform:wasm32-unknown-emscripten": [],
|
||||
"@rules_rust//rust/platform:wasm32-unknown-unknown": [],
|
||||
"@rules_rust//rust/platform:wasm32-wasip1": [],
|
||||
"@rules_rust//rust/platform:wasm32-wasip1-threads": [],
|
||||
"@rules_rust//rust/platform:wasm32-wasip2": [],
|
||||
"@rules_rust//rust/platform:x86_64-apple-darwin": [],
|
||||
"@rules_rust//rust/platform:x86_64-apple-ios": [],
|
||||
"@rules_rust//rust/platform:x86_64-apple-ios-macabi": [],
|
||||
"@rules_rust//rust/platform:x86_64-linux-android": [],
|
||||
"@rules_rust//rust/platform:x86_64-pc-windows-msvc": [],
|
||||
"@rules_rust//rust/platform:x86_64-unknown-freebsd": [],
|
||||
"@rules_rust//rust/platform:x86_64-unknown-fuchsia": [],
|
||||
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [],
|
||||
"@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [],
|
||||
"@rules_rust//rust/platform:x86_64-unknown-none": [],
|
||||
"@rules_rust//rust/platform:x86_64-unknown-uefi": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}),
|
||||
version = "1.1.5",
|
||||
deps = select({
|
||||
"@rules_rust//rust/platform:aarch64-pc-windows-msvc": [
|
||||
"//third_party/crates/windows-sys-0.61.2:windows_sys", # cfg(windows)
|
||||
],
|
||||
"@rules_rust//rust/platform:i686-pc-windows-msvc": [
|
||||
"//third_party/crates/windows-sys-0.61.2:windows_sys", # cfg(windows)
|
||||
],
|
||||
"@rules_rust//rust/platform:x86_64-pc-windows-msvc": [
|
||||
"//third_party/crates/windows-sys-0.61.2:windows_sys", # cfg(windows)
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
90
third_party/crates/anstyle-query-1.1.5/Cargo.lock
generated
vendored
Normal file
90
third_party/crates/anstyle-query-1.1.5/Cargo.lock
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-query"
|
||||
version = "1.1.5"
|
||||
dependencies = [
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.60.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
||||
dependencies = [
|
||||
"windows-targets",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.53.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
|
||||
173
third_party/crates/anstyle-query-1.1.5/Cargo.toml
vendored
Normal file
173
third_party/crates/anstyle-query-1.1.5/Cargo.toml
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
# 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 = "2021"
|
||||
rust-version = "1.66.0"
|
||||
name = "anstyle-query"
|
||||
version = "1.1.5"
|
||||
build = false
|
||||
include = [
|
||||
"build.rs",
|
||||
"src/**/*",
|
||||
"Cargo.toml",
|
||||
"Cargo.lock",
|
||||
"LICENSE*",
|
||||
"README.md",
|
||||
"examples/**/*",
|
||||
]
|
||||
autolib = false
|
||||
autobins = false
|
||||
autoexamples = false
|
||||
autotests = false
|
||||
autobenches = false
|
||||
description = "Look up colored console capabilities"
|
||||
readme = "README.md"
|
||||
keywords = [
|
||||
"cli",
|
||||
"color",
|
||||
"no-std",
|
||||
"terminal",
|
||||
"ansi",
|
||||
]
|
||||
categories = ["command-line-interface"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/rust-cli/anstyle.git"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = [
|
||||
"--cfg",
|
||||
"docsrs",
|
||||
"--generate-link-to-definition",
|
||||
]
|
||||
|
||||
[[package.metadata.release.pre-release-replacements]]
|
||||
file = "CHANGELOG.md"
|
||||
search = "Unreleased"
|
||||
replace = "{{version}}"
|
||||
min = 1
|
||||
|
||||
[[package.metadata.release.pre-release-replacements]]
|
||||
file = "CHANGELOG.md"
|
||||
search = '\.\.\.HEAD'
|
||||
replace = "...{{tag_name}}"
|
||||
exactly = 1
|
||||
|
||||
[[package.metadata.release.pre-release-replacements]]
|
||||
file = "CHANGELOG.md"
|
||||
search = "ReleaseDate"
|
||||
replace = "{{date}}"
|
||||
min = 1
|
||||
|
||||
[[package.metadata.release.pre-release-replacements]]
|
||||
file = "CHANGELOG.md"
|
||||
search = "<!-- next-header -->"
|
||||
replace = """
|
||||
<!-- next-header -->
|
||||
## [Unreleased] - ReleaseDate
|
||||
"""
|
||||
exactly = 1
|
||||
|
||||
[[package.metadata.release.pre-release-replacements]]
|
||||
file = "CHANGELOG.md"
|
||||
search = "<!-- next-url -->"
|
||||
replace = """
|
||||
<!-- next-url -->
|
||||
[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD"""
|
||||
exactly = 1
|
||||
|
||||
[lib]
|
||||
name = "anstyle_query"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[example]]
|
||||
name = "query"
|
||||
path = "examples/query.rs"
|
||||
|
||||
[target."cfg(windows)".dependencies.windows-sys]
|
||||
version = ">=0.60.2, <0.62"
|
||||
features = [
|
||||
"Win32_System_Console",
|
||||
"Win32_Foundation",
|
||||
]
|
||||
|
||||
[lints.clippy]
|
||||
bool_assert_comparison = "allow"
|
||||
branches_sharing_code = "allow"
|
||||
checked_conversions = "warn"
|
||||
collapsible_else_if = "allow"
|
||||
create_dir = "warn"
|
||||
dbg_macro = "warn"
|
||||
debug_assert_with_mut_call = "warn"
|
||||
doc_markdown = "warn"
|
||||
empty_enum = "warn"
|
||||
enum_glob_use = "warn"
|
||||
expl_impl_clone_on_copy = "warn"
|
||||
explicit_deref_methods = "warn"
|
||||
explicit_into_iter_loop = "warn"
|
||||
fallible_impl_from = "warn"
|
||||
filter_map_next = "warn"
|
||||
flat_map_option = "warn"
|
||||
float_cmp_const = "warn"
|
||||
fn_params_excessive_bools = "warn"
|
||||
from_iter_instead_of_collect = "warn"
|
||||
if_same_then_else = "allow"
|
||||
implicit_clone = "warn"
|
||||
imprecise_flops = "warn"
|
||||
inconsistent_struct_constructor = "warn"
|
||||
inefficient_to_string = "warn"
|
||||
infinite_loop = "warn"
|
||||
invalid_upcast_comparisons = "warn"
|
||||
large_digit_groups = "warn"
|
||||
large_stack_arrays = "warn"
|
||||
large_types_passed_by_value = "warn"
|
||||
let_and_return = "allow"
|
||||
linkedlist = "warn"
|
||||
lossy_float_literal = "warn"
|
||||
macro_use_imports = "warn"
|
||||
mem_forget = "warn"
|
||||
mutex_integer = "warn"
|
||||
needless_continue = "allow"
|
||||
needless_for_each = "warn"
|
||||
negative_feature_names = "warn"
|
||||
path_buf_push_overwrite = "warn"
|
||||
ptr_as_ptr = "warn"
|
||||
rc_mutex = "warn"
|
||||
redundant_feature_names = "warn"
|
||||
ref_option_ref = "warn"
|
||||
rest_pat_in_fully_bound_structs = "warn"
|
||||
result_large_err = "allow"
|
||||
same_functions_in_if_condition = "warn"
|
||||
self_named_module_files = "warn"
|
||||
semicolon_if_nothing_returned = "warn"
|
||||
str_to_string = "warn"
|
||||
string_add = "warn"
|
||||
string_add_assign = "warn"
|
||||
string_lit_as_bytes = "warn"
|
||||
todo = "warn"
|
||||
trait_duplication_in_bounds = "warn"
|
||||
uninlined_format_args = "warn"
|
||||
verbose_file_reads = "warn"
|
||||
wildcard_imports = "warn"
|
||||
zero_sized_map_values = "warn"
|
||||
|
||||
[lints.rust]
|
||||
unnameable_types = "warn"
|
||||
unreachable_pub = "warn"
|
||||
unsafe_op_in_unsafe_fn = "warn"
|
||||
unused_lifetimes = "warn"
|
||||
unused_macro_rules = "warn"
|
||||
unused_qualifications = "warn"
|
||||
|
||||
[lints.rust.rust_2018_idioms]
|
||||
level = "warn"
|
||||
priority = -1
|
||||
30
third_party/crates/anstyle-query-1.1.5/Cargo.toml.orig
generated
vendored
Normal file
30
third_party/crates/anstyle-query-1.1.5/Cargo.toml.orig
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
[package]
|
||||
name = "anstyle-query"
|
||||
version = "1.1.5"
|
||||
description = "Look up colored console capabilities"
|
||||
categories = ["command-line-interface"]
|
||||
keywords = ["cli", "color", "no-std", "terminal", "ansi"]
|
||||
repository.workspace = true
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
include.workspace = true
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
|
||||
|
||||
[package.metadata.release]
|
||||
pre-release-replacements = [
|
||||
{file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1},
|
||||
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1},
|
||||
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1},
|
||||
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1},
|
||||
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1},
|
||||
]
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
windows-sys = { version = ">=0.60.2, <0.62", features = ["Win32_System_Console", "Win32_Foundation"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
202
third_party/crates/anstyle-query-1.1.5/LICENSE-APACHE
vendored
Normal file
202
third_party/crates/anstyle-query-1.1.5/LICENSE-APACHE
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
19
third_party/crates/anstyle-query-1.1.5/LICENSE-MIT
vendored
Normal file
19
third_party/crates/anstyle-query-1.1.5/LICENSE-MIT
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) Individual contributors
|
||||
|
||||
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.
|
||||
25
third_party/crates/anstyle-query-1.1.5/README.md
vendored
Normal file
25
third_party/crates/anstyle-query-1.1.5/README.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# anstyle-query
|
||||
|
||||
> **Low level terminal capability lookups**
|
||||
|
||||
[][Documentation]
|
||||

|
||||
[](https://crates.io/crates/anstyle-query)
|
||||
|
||||
## License
|
||||
|
||||
Licensed under either of
|
||||
|
||||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
|
||||
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/license/mit>)
|
||||
|
||||
at your option.
|
||||
|
||||
## [Contribute](../../CONTRIBUTING.md)
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally
|
||||
submitted for inclusion in the work by you, as defined in the Apache-2.0
|
||||
license, shall be dual-licensed as above, without any additional terms or
|
||||
conditions.
|
||||
|
||||
[Documentation]: https://docs.rs/anstyle-query
|
||||
26
third_party/crates/anstyle-query-1.1.5/examples/query.rs
vendored
Normal file
26
third_party/crates/anstyle-query-1.1.5/examples/query.rs
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
//! Report a terminal's capabilities
|
||||
|
||||
fn main() {
|
||||
println!("clicolor: {:?}", anstyle_query::clicolor());
|
||||
println!("clicolor_force: {}", anstyle_query::clicolor_force());
|
||||
println!("no_color: {}", anstyle_query::no_color());
|
||||
println!(
|
||||
"term_supports_ansi_color: {}",
|
||||
anstyle_query::term_supports_ansi_color()
|
||||
);
|
||||
println!(
|
||||
"term_supports_color: {}",
|
||||
anstyle_query::term_supports_color()
|
||||
);
|
||||
println!("truecolor: {}", anstyle_query::truecolor());
|
||||
println!(
|
||||
"enable_ansi_colors: {:?}",
|
||||
anstyle_query::windows::enable_ansi_colors()
|
||||
);
|
||||
#[cfg(windows)]
|
||||
println!(
|
||||
" enable_virtual_terminal_processing: {:?}",
|
||||
anstyle_query::windows::enable_virtual_terminal_processing()
|
||||
);
|
||||
println!("is_ci: {:?}", anstyle_query::is_ci());
|
||||
}
|
||||
163
third_party/crates/anstyle-query-1.1.5/src/lib.rs
vendored
Normal file
163
third_party/crates/anstyle-query-1.1.5/src/lib.rs
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
//! Low level terminal capability lookups
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
#![warn(missing_docs)]
|
||||
#![warn(clippy::print_stderr)]
|
||||
#![warn(clippy::print_stdout)]
|
||||
|
||||
pub mod windows;
|
||||
|
||||
/// Check [CLICOLOR] status
|
||||
///
|
||||
/// - When `true`, ANSI colors are supported and should be used when the program isn't piped,
|
||||
/// similar to [`term_supports_color`]
|
||||
/// - When `false`, don’t output ANSI color escape codes, similar to [`no_color`]
|
||||
///
|
||||
/// See also:
|
||||
/// - [terminfo](https://crates.io/crates/terminfo) or [term](https://crates.io/crates/term) for
|
||||
/// checking termcaps
|
||||
/// - [termbg](https://crates.io/crates/termbg) for detecting background color
|
||||
///
|
||||
/// [CLICOLOR]: https://bixense.com/clicolors/
|
||||
#[inline]
|
||||
pub fn clicolor() -> Option<bool> {
|
||||
let value = std::env::var_os("CLICOLOR")?;
|
||||
Some(value != "0")
|
||||
}
|
||||
|
||||
/// Check [CLICOLOR_FORCE] status
|
||||
///
|
||||
/// ANSI colors should be enabled no matter what.
|
||||
///
|
||||
/// [CLICOLOR_FORCE]: https://bixense.com/clicolors/
|
||||
#[inline]
|
||||
pub fn clicolor_force() -> bool {
|
||||
non_empty(std::env::var_os("CLICOLOR_FORCE").as_deref())
|
||||
}
|
||||
|
||||
/// Check [NO_COLOR] status
|
||||
///
|
||||
/// When `true`, should prevent the addition of ANSI color.
|
||||
///
|
||||
/// User-level configuration files and per-instance command-line arguments should override
|
||||
/// [NO_COLOR]. A user should be able to export `$NO_COLOR` in their shell configuration file as a
|
||||
/// default, but configure a specific program in its configuration file to specifically enable
|
||||
/// color.
|
||||
///
|
||||
/// [NO_COLOR]: https://no-color.org/
|
||||
#[inline]
|
||||
pub fn no_color() -> bool {
|
||||
non_empty(std::env::var_os("NO_COLOR").as_deref())
|
||||
}
|
||||
|
||||
/// Check `TERM` for color support
|
||||
#[inline]
|
||||
pub fn term_supports_color() -> bool {
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
match std::env::var_os("TERM") {
|
||||
// If TERM isn't set, then we are in a weird environment that
|
||||
// probably doesn't support colors.
|
||||
None => return false,
|
||||
Some(k) => {
|
||||
if k == "dumb" {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
// On Windows, if TERM isn't set, then we shouldn't automatically
|
||||
// assume that colors aren't allowed. This is unlike Unix environments
|
||||
// where TERM is more rigorously set.
|
||||
if let Some(k) = std::env::var_os("TERM") {
|
||||
if k == "dumb" {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
/// Check `TERM` for ANSI color support
|
||||
///
|
||||
/// On Windows, you might need to also check [`windows::enable_ansi_colors`] as ANSI color support
|
||||
/// is opt-in, rather than assumed.
|
||||
#[inline]
|
||||
pub fn term_supports_ansi_color() -> bool {
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
term_supports_color()
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
match std::env::var_os("TERM") {
|
||||
None => return false,
|
||||
Some(k) => {
|
||||
// cygwin doesn't seem to support ANSI escape sequences
|
||||
// and instead has its own variety. However, the Windows
|
||||
// console API may be available.
|
||||
if k == "dumb" || k == "cygwin" {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
/// Check [COLORTERM] for truecolor support
|
||||
///
|
||||
/// [COLORTERM]: https://github.com/termstandard/colors
|
||||
#[inline]
|
||||
pub fn truecolor() -> bool {
|
||||
let value = std::env::var_os("COLORTERM");
|
||||
let value = value.as_deref().unwrap_or_default();
|
||||
value == "truecolor" || value == "24bit"
|
||||
}
|
||||
|
||||
/// Report whether this is running in CI
|
||||
///
|
||||
/// CI is a common environment where, despite being piped, ansi color codes are supported
|
||||
///
|
||||
/// This is not as exhaustive as you'd find in a crate like `is_ci` but it should work in enough
|
||||
/// cases.
|
||||
#[inline]
|
||||
pub fn is_ci() -> bool {
|
||||
// Assuming its CI based on presence because who would be setting `CI=false`?
|
||||
//
|
||||
// This makes it easier to all of the potential values when considering our known values:
|
||||
// - Gitlab and Github set it to `true`
|
||||
// - Woodpecker sets it to `woodpecker`
|
||||
std::env::var_os("CI").is_some()
|
||||
}
|
||||
|
||||
fn non_empty(var: Option<&std::ffi::OsStr>) -> bool {
|
||||
!var.unwrap_or_default().is_empty()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn non_empty_not_present() {
|
||||
assert!(!non_empty(None));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_empty_empty() {
|
||||
assert!(!non_empty(Some(std::ffi::OsStr::new(""))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_empty_texty() {
|
||||
assert!(non_empty(Some(std::ffi::OsStr::new("hello"))));
|
||||
}
|
||||
}
|
||||
|
||||
#[doc = include_str!("../README.md")]
|
||||
#[cfg(doctest)]
|
||||
pub struct ReadmeDoctests;
|
||||
79
third_party/crates/anstyle-query-1.1.5/src/windows.rs
vendored
Normal file
79
third_party/crates/anstyle-query-1.1.5/src/windows.rs
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
//! Windows-specific style queries
|
||||
|
||||
#[cfg(windows)]
|
||||
mod windows_console {
|
||||
use std::os::windows::io::AsRawHandle;
|
||||
use std::os::windows::io::RawHandle;
|
||||
|
||||
use windows_sys::Win32::Foundation::HANDLE;
|
||||
use windows_sys::Win32::System::Console::CONSOLE_MODE;
|
||||
use windows_sys::Win32::System::Console::ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||
|
||||
fn enable_vt(handle: RawHandle) -> std::io::Result<()> {
|
||||
unsafe {
|
||||
let handle: HANDLE = handle as HANDLE;
|
||||
if handle.is_null() {
|
||||
return Err(std::io::Error::new(
|
||||
std::io::ErrorKind::BrokenPipe,
|
||||
"console is detached",
|
||||
));
|
||||
}
|
||||
|
||||
let mut dwmode: CONSOLE_MODE = 0;
|
||||
if windows_sys::Win32::System::Console::GetConsoleMode(handle, &mut dwmode) == 0 {
|
||||
return Err(std::io::Error::last_os_error());
|
||||
}
|
||||
|
||||
dwmode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||
if windows_sys::Win32::System::Console::SetConsoleMode(handle, dwmode) == 0 {
|
||||
return Err(std::io::Error::last_os_error());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn enable_virtual_terminal_processing() -> std::io::Result<()> {
|
||||
let stdout = std::io::stdout();
|
||||
let stdout_handle = stdout.as_raw_handle();
|
||||
let stderr = std::io::stderr();
|
||||
let stderr_handle = stderr.as_raw_handle();
|
||||
|
||||
enable_vt(stdout_handle)?;
|
||||
if stdout_handle != stderr_handle {
|
||||
enable_vt(stderr_handle)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn enable_ansi_colors() -> Option<bool> {
|
||||
Some(
|
||||
enable_virtual_terminal_processing()
|
||||
.map(|_| true)
|
||||
.unwrap_or(false),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
mod windows_console {
|
||||
#[inline]
|
||||
pub(crate) fn enable_ansi_colors() -> Option<bool> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Enable ANSI escape codes ([`ENABLE_VIRTUAL_TERMINAL_PROCESSING`](https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences))
|
||||
///
|
||||
/// For non-windows systems, returns `None`
|
||||
pub fn enable_ansi_colors() -> Option<bool> {
|
||||
windows_console::enable_ansi_colors()
|
||||
}
|
||||
|
||||
/// Raw `ENABLE_VIRTUAL_TERMINAL_PROCESSING` on stdout/stderr
|
||||
#[cfg(windows)]
|
||||
pub fn enable_virtual_terminal_processing() -> std::io::Result<()> {
|
||||
windows_console::enable_virtual_terminal_processing()
|
||||
}
|
||||
Reference in New Issue
Block a user