driver_tools/subcommands/list_devices/
args.rs

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.
4
5use argh::{ArgsInfo, FromArgs};
6
7#[derive(ArgsInfo, FromArgs, Debug, PartialEq)]
8#[argh(
9    subcommand,
10    name = "list-devices",
11    description = "List devices",
12    example = "To list all devices:
13
14    $ driver list-devices -v",
15    error_code(1, "Failed to connect to the driver development service")
16)]
17pub struct ListDevicesCommand {
18    /// device filter - either an exact topo path, or a fuzzy match on the device's name.
19    #[argh(positional)]
20    pub device: Option<String>,
21
22    /// if this exists, the user will be prompted for a component to select.
23    #[argh(switch, short = 's', long = "select")]
24    pub select: bool,
25
26    /// list all device properties.
27    #[argh(switch, short = 'v', long = "verbose")]
28    pub verbose: bool,
29
30    /// require an exact match on the device filter, instead of a substring match.
31    #[argh(switch, long = "exact")]
32    pub exact: bool,
33
34    /// return a non-zero exit code if no matching devices are found.
35    #[argh(switch, long = "fail-on-missing")]
36    pub fail_on_missing: bool,
37
38    /// list only unbound nodes.
39    #[argh(switch, short = 'u', long = "unbound")]
40    pub unbound: bool,
41}