use clap::{Parser, Subcommand};
use matrix65::serial::DEFAULT_BAUD_RATE;
#[derive(Debug, Subcommand)]
pub enum Commands {
#[clap(arg_required_else_help = true)]
Prg {
#[clap(value_parser)]
file: String,
#[clap(long, action)]
reset: bool,
#[clap(long, short = 'r', action)]
run: bool,
},
#[clap(arg_required_else_help = true)]
Type {
#[clap(value_parser)]
text: String,
},
Reset {
#[clap(long, action)]
c64: bool,
},
#[clap(arg_required_else_help = true)]
Peek {
#[clap(long, short = '@')]
address: String,
#[clap(long = "num", short = 'n', default_value_t = 1)]
length: usize,
#[clap(long, short = 'o')]
outfile: Option<String>,
#[clap(long = "dasm", short = 'd', action, conflicts_with = "outfile")]
disassemble: bool,
},
#[clap(arg_required_else_help = true)]
Poke {
#[clap(long, short = '@')]
address: String,
#[clap(long, short = 'f')]
file: Option<String>,
#[clap(value_parser, conflicts_with = "file")]
value: Option<u8>,
},
#[clap()]
Filehost {},
#[clap()]
Cmd {},
}
#[derive(Parser)]
#[clap(version, about, long_about = None, author = "Copyright (c) 2022 Wombat - Apache/MIT Licensed")]
pub struct Args {
#[clap(subcommand)]
pub command: Commands,
#[clap(short = 'p', long)]
pub port: String,
#[clap(short = 'b', long, default_value_t = DEFAULT_BAUD_RATE)]
pub baud: u32,
#[clap(long, short = 'v', action)]
pub verbose: bool,
}