blob: 366980a83296b14b2ad3ef69c049b0f9742e969c [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use argh::{ArgsInfo, FromArgs};
#[derive(ArgsInfo, FromArgs, Clone, Debug, PartialEq)]
#[argh(subcommand, name = "dns")]
/// commands to control the dns resolver
pub struct Dns {
#[argh(subcommand)]
pub dns_cmd: DnsEnum,
}
#[derive(ArgsInfo, FromArgs, Clone, Debug, PartialEq)]
#[argh(subcommand)]
pub enum DnsEnum {
Lookup(Lookup),
}
#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
#[argh(subcommand, name = "lookup")]
/// performs dns resolution on the specified hostname
pub struct Lookup {
#[argh(positional)]
pub hostname: String,
#[argh(option, default = "true")]
/// include ipv4 results (defaults to true)
pub ipv4: bool,
#[argh(option, default = "true")]
/// include ipv6 results (defaults to true)
pub ipv6: bool,
#[argh(option, default = "true")]
/// sort addresses in order of preference (defaults to true)
pub sort: bool,
}