Skip to content

Commit bb66fd7

Browse files
committed
Clarify CLI help and fix wrong default piece set
1 parent 0774e48 commit bb66fd7

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

src/main.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -207,34 +207,6 @@ fn gen_color(palette: ColorPalette) -> Option<Color> {
207207
}
208208
}
209209

210-
/// State of the screensaver.
211-
#[derive(Debug)]
212-
struct State {
213-
/// Current pipe piece to be drawn.
214-
pipe_piece: PipePiece,
215-
/// Number of pieces not drawn yet.
216-
pieces_remaining: u32,
217-
/// Number of currently drawn pieces.
218-
drawn_pieces: u32,
219-
}
220-
221-
impl Default for State {
222-
fn default() -> Self {
223-
Self {
224-
pipe_piece: PipePiece::new(),
225-
pieces_remaining: 0,
226-
drawn_pieces: 0,
227-
}
228-
}
229-
}
230-
231-
impl State {
232-
/// Create a `State`.
233-
fn new() -> Self {
234-
Default::default()
235-
}
236-
}
237-
238210
/// Drawing area of the terminal. Wrapper over crossterm.
239211
#[derive(Debug)]
240212
struct Canvas {
@@ -343,19 +315,19 @@ struct Config {
343315
#[arg(short, long, default_value_t = 1000, verbatim_doc_comment)]
344316
max_drawn_pieces: u32,
345317
/// Maximum length of pipe in pieces.
346-
/// Must not equal to --min-pipe-length.
318+
/// Must not equal to or be less than --min-pipe-length.
347319
#[arg(long, default_value_t = 300, verbatim_doc_comment)]
348320
max_pipe_length: u32,
349321
/// Minimal length of pipe in pieces.
350-
/// Must not equal to --max-pipe-length.
322+
/// Must not equal to or be greater than --max-pipe-length.
351323
#[arg(long, default_value_t = 7, verbatim_doc_comment)]
352324
min_pipe_length: u32,
353325
/// Probability of turning a pipe as a percentage in a decimal form.
354326
#[arg(short = 't', long, default_value_t = 0.2)]
355327
turning_prob: f64,
356328
/// Set of colors used for coloring each pipe.
357-
/// `None` disables this feature. Base colors are 16 predefined colors by the terminal.
358-
/// The RGB option is for terminals, which support true color, i.e., all 16 million colors.
329+
/// `None` disables this feature. Base colors are 16 colors predefined by the terminal.
330+
/// The RGB option is for terminals with true color support (all 16 million colors).
359331
#[arg(short, long, default_value_t, value_enum, verbatim_doc_comment)]
360332
palette: ColorPalette,
361333
/// A set of pieces to use.
@@ -375,10 +347,38 @@ struct Config {
375347
/// 6 - bold pipes (default):
376348
/// ┃━ ┓┗ ┛┏ ┗━ ━┓ ━┃━
377349
/// This parameter expects a numeric ID.
378-
#[arg(short = 'P', long, default_value_t = 5, value_parser = 0..=6, verbatim_doc_comment)]
350+
#[arg(short = 'P', long, default_value_t = 6, value_parser = 0..=6, verbatim_doc_comment)]
379351
piece_set: i64,
380352
}
381353

354+
/// State of the screensaver.
355+
#[derive(Debug)]
356+
struct State {
357+
/// Current pipe piece to be drawn.
358+
pipe_piece: PipePiece,
359+
/// Number of pieces not drawn yet.
360+
pieces_remaining: u32,
361+
/// Number of currently drawn pieces.
362+
drawn_pieces: u32,
363+
}
364+
365+
impl Default for State {
366+
fn default() -> Self {
367+
Self {
368+
pipe_piece: PipePiece::new(),
369+
pieces_remaining: 0,
370+
drawn_pieces: 0,
371+
}
372+
}
373+
}
374+
375+
impl State {
376+
/// Create a `State`.
377+
fn new() -> Self {
378+
Default::default()
379+
}
380+
}
381+
382382
/// Represents the screensaver application.
383383
#[derive(Debug)]
384384
struct Screensaver {

0 commit comments

Comments
 (0)