mirror of
https://github.com/uutils/hostname.git
synced 2026-06-10 16:13:44 -07:00
Adapt formatting with fmt
This commit is contained in:
+3
-1
@@ -20,7 +20,9 @@ fn main() -> io::Result<()> {
|
||||
|
||||
if tldr_zip.is_none() {
|
||||
println!("Warning: No tldr archive found, so the documentation will not include examples.");
|
||||
println!("To include examples in the documentation, download the tldr archive and put it in the docs/ folder.");
|
||||
println!(
|
||||
"To include examples in the documentation, download the tldr archive and put it in the docs/ folder."
|
||||
);
|
||||
println!();
|
||||
println!(" curl https://tldr.sh/assets/tldr.zip -o docs/tldr.zip");
|
||||
println!();
|
||||
|
||||
@@ -12,7 +12,7 @@ mod utils;
|
||||
use std::ffi::OsString;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::{crate_version, value_parser, Arg, ArgAction, ArgGroup, Command};
|
||||
use clap::{Arg, ArgAction, ArgGroup, Command, crate_version, value_parser};
|
||||
use uucore::{error::UResult, format_usage, help_about, help_usage};
|
||||
|
||||
const ABOUT: &str = help_about!("hostname.md");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
use std::ffi::{c_int, CStr, CString};
|
||||
use std::ffi::{CStr, CString, c_int};
|
||||
use std::ptr;
|
||||
use std::ptr::NonNull;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
use std::ffi::{c_int, OsStr, OsString};
|
||||
use std::ffi::{OsStr, OsString, c_int};
|
||||
use std::os::windows::ffi::{OsStrExt, OsStringExt};
|
||||
use std::ptr::NonNull;
|
||||
use std::{mem, ptr};
|
||||
@@ -14,12 +14,12 @@ use windows_sys::Win32::Foundation::{
|
||||
ERROR_MORE_DATA, ERROR_NO_DATA, ERROR_SUCCESS,
|
||||
};
|
||||
use windows_sys::Win32::NetworkManagement::IpHelper::{
|
||||
GetAdaptersAddresses, GAA_FLAG_SKIP_DNS_SERVER, GAA_FLAG_SKIP_FRIENDLY_NAME,
|
||||
GAA_FLAG_SKIP_DNS_SERVER, GAA_FLAG_SKIP_FRIENDLY_NAME, GetAdaptersAddresses,
|
||||
IP_ADAPTER_ADDRESSES_LH, IP_ADAPTER_UNICAST_ADDRESS_LH,
|
||||
};
|
||||
use windows_sys::Win32::Networking::WinSock::{
|
||||
socklen_t, FreeAddrInfoW, GetAddrInfoW, GetNameInfoW, WSACleanup, WSAGetLastError, WSAStartup,
|
||||
ADDRINFOW, AF_UNSPEC, IN6_ADDR, SOCKADDR, WSADATA, WSAENAMETOOLONG, WSAENOBUFS,
|
||||
ADDRINFOW, AF_UNSPEC, FreeAddrInfoW, GetAddrInfoW, GetNameInfoW, IN6_ADDR, SOCKADDR,
|
||||
WSACleanup, WSADATA, WSAENAMETOOLONG, WSAENOBUFS, WSAGetLastError, WSAStartup, socklen_t,
|
||||
};
|
||||
use windows_sys::Win32::System::SystemInformation::{
|
||||
ComputerNamePhysicalDnsDomain, ComputerNamePhysicalDnsFullyQualified,
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
use std::ffi::{c_int, c_uint, CStr};
|
||||
use std::ffi::{CStr, c_int, c_uint};
|
||||
use std::ptr::NonNull;
|
||||
|
||||
use libc::{
|
||||
sockaddr, sockaddr_in, sockaddr_in6, socklen_t, AF_UNSPEC, AI_CANONNAME, IFF_LOOPBACK, IFF_UP,
|
||||
NI_NAMEREQD, NI_NUMERICHOST, SOCK_DGRAM,
|
||||
AF_UNSPEC, AI_CANONNAME, IFF_LOOPBACK, IFF_UP, NI_NAMEREQD, NI_NUMERICHOST, SOCK_DGRAM,
|
||||
sockaddr, sockaddr_in, sockaddr_in6, socklen_t,
|
||||
};
|
||||
use uucore::error::UResult;
|
||||
|
||||
use crate::errors::{GetNameOrAddrInfoError, HostNameError};
|
||||
use crate::net::{
|
||||
domain_name, get_name_info, host_name, in6_is_addr_linklocal, in6_is_addr_mc_linklocal,
|
||||
short_host_name, AddressInfo, InterfaceAddresses,
|
||||
AddressInfo, InterfaceAddresses, domain_name, get_name_info, host_name, in6_is_addr_linklocal,
|
||||
in6_is_addr_mc_linklocal, short_host_name,
|
||||
};
|
||||
use crate::print::{
|
||||
AliasHostName, AllFqdnHostName, AllIpAddressesHostName, DefaultHostName, DomainHostName,
|
||||
|
||||
@@ -12,15 +12,15 @@ use windows_sys::Win32::NetworkManagement::IpHelper::{
|
||||
};
|
||||
use windows_sys::Win32::NetworkManagement::Ndis::IfOperStatusUp;
|
||||
use windows_sys::Win32::Networking::WinSock::{
|
||||
AF_INET, AF_INET6, AF_UNSPEC, NI_NAMEREQD, NI_NUMERICHOST, SOCKADDR, SOCKADDR_IN6, SOCK_DGRAM,
|
||||
AF_INET, AF_INET6, AF_UNSPEC, NI_NAMEREQD, NI_NUMERICHOST, SOCK_DGRAM, SOCKADDR, SOCKADDR_IN6,
|
||||
WSAHOST_NOT_FOUND,
|
||||
};
|
||||
|
||||
use crate::errors::HostNameError;
|
||||
use crate::net::{
|
||||
domain_name, fully_qualified_dns_name, get_name_info, host_name, in6_is_addr_linklocal,
|
||||
in6_is_addr_mc_linklocal, short_host_name, AdapterUnicastAddressIter, AddressInfo,
|
||||
InterfaceAddresses,
|
||||
AdapterUnicastAddressIter, AddressInfo, InterfaceAddresses, domain_name,
|
||||
fully_qualified_dns_name, get_name_info, host_name, in6_is_addr_linklocal,
|
||||
in6_is_addr_mc_linklocal, short_host_name,
|
||||
};
|
||||
use crate::print::{
|
||||
AliasHostName, AllFqdnHostName, AllIpAddressesHostName, DefaultHostName, DomainHostName,
|
||||
|
||||
Reference in New Issue
Block a user