blob: 2caa1a18d4a2199cc0db0bd6f74a68307e02610c [file] [log] [blame]
// Copyright 2020 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 anyhow::Result;
use ffx_emulator::vdl_files::VDLFiles;
use ffx_emulator_args::{Args, VDLCommand};
fn main() -> Result<()> {
let Args { command, sdk } = argh::from_env();
process_command(command, sdk)
}
fn process_command(command: VDLCommand, is_sdk: bool) -> Result<()> {
match command {
VDLCommand::Start(start_command) => {
VDLFiles::new(is_sdk)?.start_emulator(&start_command)?;
}
VDLCommand::Kill(stop_command) => {
VDLFiles::new(is_sdk)?.stop_vdl(&stop_command)?;
}
}
Ok(())
}