driver_tools/subcommands/register/
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 = "register",
11    description = "Informs the driver manager that a new driver package is available. The driver manager will cache a copy of the driver",
12    example = "To register a driver
13
14    $ driver register 'fuchsia-pkg://fuchsia.com/example_driver#meta/example_driver.cm'",
15    error_code(1, "Failed to connect to the driver registrar service")
16)]
17pub struct RegisterCommand {
18    #[argh(positional, description = "component URL of the driver to be registered.")]
19    pub url: String,
20
21    /// if this exists, the user will be prompted for a component to select.
22    #[argh(switch, short = 's', long = "select")]
23    pub select: bool,
24}