use genie::hki::HotkeyInfo;
use std::fs::File;
use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "Set Hotkey")]
struct DisplayHotkey {
#[structopt(name = "file-name")]
file_name: PathBuf,
#[structopt(name = "group-index")]
group_index: usize,
#[structopt(name = "hotkey-index")]
hotkey_index: usize,
}
fn main() -> anyhow::Result<()> {
let cli_input = DisplayHotkey::from_args();
let mut f = File::open(&cli_input.file_name)?;
let info = HotkeyInfo::from(&mut f)?;
let group = info.group(cli_input.group_index).unwrap();
let hotkey = group.hotkey(cli_input.hotkey_index).unwrap();
println!("{}", hotkey);
Ok(())
}