mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-25 20:12:14 +03:00
Print host architecture with --version
This commit is contained in:
parent
ffa4052f32
commit
c56bc1380e
@ -113,8 +113,9 @@ impl From<ErrorFormat> for hurl::util::logger::ErrorFormat {
|
||||
fn get_version() -> String {
|
||||
let libcurl_version = http::libcurl_version_info();
|
||||
format!(
|
||||
"{} {}\nFeatures (libcurl): {}\nFeatures (built-in): brotli",
|
||||
"{} ({}) {}\nFeatures (libcurl): {}\nFeatures (built-in): brotli",
|
||||
clap::crate_version!(),
|
||||
libcurl_version.host,
|
||||
libcurl_version.libraries.join(" "),
|
||||
libcurl_version.features.join(" ")
|
||||
)
|
||||
|
@ -20,6 +20,7 @@ use std::collections::HashMap;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct CurlVersionInfo {
|
||||
pub host: String,
|
||||
pub libraries: Vec<String>,
|
||||
pub features: Vec<String>,
|
||||
}
|
||||
@ -31,6 +32,7 @@ pub struct CurlVersionInfo {
|
||||
/// - <https://github.com/curl/curl/blob/master/src/tool_help.c>
|
||||
pub fn libcurl_version_info() -> CurlVersionInfo {
|
||||
let version = curl::Version::get();
|
||||
let host = version.host().to_string();
|
||||
let mut libraries = vec![format!("libcurl/{}", version.version())];
|
||||
if let Some(s) = version.ssl_version() {
|
||||
libraries.push(s.to_string());
|
||||
@ -117,6 +119,7 @@ pub fn libcurl_version_info() -> CurlVersionInfo {
|
||||
features.sort_by_key(|k| k.to_lowercase());
|
||||
|
||||
CurlVersionInfo {
|
||||
host,
|
||||
libraries,
|
||||
features,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user