1// Copyright 2022 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
45use argh::{ArgsInfo, FromArgs};
67#[derive(ArgsInfo, FromArgs, Clone, Debug, PartialEq)]
8#[argh(subcommand, name = "dns")]
9/// commands to control the dns resolver
10pub struct Dns {
11#[argh(subcommand)]
12pub dns_cmd: DnsEnum,
13}
1415#[derive(ArgsInfo, FromArgs, Clone, Debug, PartialEq)]
16#[argh(subcommand)]
17pub enum DnsEnum {
18 Lookup(Lookup),
19}
2021#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
22#[argh(subcommand, name = "lookup")]
23/// performs dns resolution on the specified hostname
24pub struct Lookup {
25#[argh(positional)]
26pub hostname: String,
27#[argh(option, default = "true")]
28/// include ipv4 results (defaults to true)
29pub ipv4: bool,
30#[argh(option, default = "true")]
31/// include ipv6 results (defaults to true)
32pub ipv6: bool,
33#[argh(option, default = "true")]
34/// sort addresses in order of preference (defaults to true)
35pub sort: bool,
36}