driver_tools/subcommands/disable/
args.rs

1// Copyright 2023 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 = "disable",
11    description = "Disables the given driver, and restart its nodes with rematching.",
12    note = "After this call, nodes that were bound to the requested driver will either have
13another driver (specifically a fallback driver) bound to them, or the node becomes an unbound node
14ready to bind to a driver later, which is generally done with a register call. If there is a
15fallback driver that might take the place of the driver being disabled, and you want to register
16your own driver for the node, the fallback driver should be disabled as well.",
17    example = "To disable a driver
18
19    $ driver disable 'fuchsia-pkg://fuchsia.com/example_driver#meta/example_driver.cm'
20
21This can also be used with boot drivers, but keep in mind if the driver being disabled is
22critical to the system, the system will become unstable.
23
24    $ driver disable 'fuchsia-boot:///#meta/example_driver.cm'",
25    error_code(1, "Failed to connect to the driver development service")
26)]
27pub struct DisableCommand {
28    #[argh(positional, description = "component URL of the driver to be disabled.")]
29    pub url: String,
30
31    /// if this exists, the user will be prompted for a component to select.
32    #[argh(switch, short = 's', long = "select")]
33    pub select: bool,
34}