Skip to content

Commit a6a5aba

Browse files
committed
Improve led matrix options documentation
And enable hyphen values in clap. You were not able to output a string like '---' previously.
1 parent ed10230 commit a6a5aba

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

inputmodule-control/src/inputmodule.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn find_serialdevs(args: &crate::ClapCli, wait_for_device: bool) -> (Vec<Str
160160
pub fn serial_commands(args: &crate::ClapCli) {
161161
let (serialdevs, waited): (Vec<String>, bool) = find_serialdevs(args, args.wait_for_device);
162162
if serialdevs.is_empty() {
163-
println!("Failed to find serial devivce. Please manually specify with --serial-dev");
163+
println!("Failed to find serial device. Please manually specify with --serial-dev");
164164
return;
165165
} else if args.wait_for_device && !waited {
166166
println!("Device already present. No need to wait. Not executing command. Sleep 1s");
@@ -843,7 +843,7 @@ fn show_font(serialdev: &str, font_items: &[Vec<u8>]) {
843843
}
844844

845845
/// Render a list of up to five symbols
846-
/// Can use letters/numbers or symbol names, like 'sun', ':)'
846+
/// Can use letters/numbers or symbol names, like 'sun' ':)'
847847
fn show_symbols(serialdev: &str, symbols: &Vec<String>) {
848848
println!("Symbols: {symbols:?}");
849849
let font_items: Vec<Vec<u8>> = symbols.iter().map(|x| convert_symbol(x)).collect();

inputmodule-control/src/ledmatrix.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,20 @@ pub struct LedMatrixSubcommand {
100100
#[arg(long)]
101101
pub clock: bool,
102102

103-
/// Display a string (max 5 chars)
104-
#[arg(long)]
103+
/// Display a string vertically (max 5 chars - letters, digits, punctuation)
104+
#[arg(long, allow_hyphen_values = true)]
105105
pub string: Option<String>,
106106

107-
/// Display a string (max 5 symbols)
108-
#[arg(long, num_args(0..6))]
107+
/// Display a string vertically (up to 5 symbols as separate arguments by symbol name or string)
108+
#[arg(long, allow_hyphen_values = true, num_args(0..6))]
109109
pub symbols: Option<Vec<String>>,
110110

111111
/// Start a game
112112
#[arg(long)]
113113
#[clap(value_enum)]
114114
pub start_game: Option<Game>,
115115

116-
/// Paramater for starting the game. Required for some games
116+
/// Parameter for starting the game. Required for some games
117117
#[arg(long)]
118118
#[clap(value_enum)]
119119
pub game_param: Option<GameOfLifeStartParam>,

0 commit comments

Comments
 (0)