Skip to content

Commit

Permalink
Tweaks to help text post clap switch
Browse files Browse the repository at this point in the history
In particular listing the options for `--style` was redundant with the
`clap::ValueEnum` help text. I also made some minor tweaks to make the
style consistent and wording clear.
  • Loading branch information
julianandrews committed Mar 2, 2024
1 parent d0cb480 commit a45d570
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sgf-render"
version = "2.6.0"
version = "2.6.1"
authors = ["Julian Andrews <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,28 @@ $ ./target/release/sgf-render -h
Usage: sgf-render [OPTIONS] [FILE]
Arguments:
[FILE] SGF file to render (defaults to stdin)
[FILE] SGF file to render [default: read from stdin]
Options:
-o, --outfile <FILE> Output file. SVG and PNG formats supported
-n, --node <PATH_SPEC> Node to render. For simple use provide a number or `last` to render the last node.
See the README for more detail
-o, --outfile <FILE> Output file [default: write to stdout]
-f, --format <OUTPUT_FORMAT> Output format [default: svg] [possible values: svg,
png]
-n, --node <PATH_SPEC> Node to render. For simple use provide a number or
`last` to render the last node. See the README for more
detail
-w, --width <WIDTH> Width of the output image in pixels [default: 800]
-s, --shrink-wrap Draw only enough of the board to hold all the stones (with 1 space padding)
-s, --shrink-wrap Draw only enough of the board to hold all the stones
(with 1 space padding)
-r, --range <RANGE> Range to draw as a pair of corners (e.g. 'cc-ff')
--style <STYLE> Style to use. One of 'simple', 'fancy' or 'minimalist' [default: simple]
--custom-style <FILE> Custom style to use. Overrides '--style'. See the README for details
--style <STYLE> Style to use [default: simple] [possible values:
minimalist, fancy, simple]
--custom-style <FILE> Custom style `toml` file. Conflicts with '--style'. See
the README for details
--move-numbers[=<RANGE>] Draw move numbers (may replace other markup)
--move-numbers-from <NUM> Number to start counting move numbers from (requires --move-numbers) [default: 1]
--move-numbers-from <NUM> Number to start counting move numbers from (requires
--move-numbers) [default: 1]
--label-sides <SIDES> Sides to draw position labels on [default: nw]
--no-board-labels Don't draw position labels
--no-marks Don't draw SGF marks
--no-triangles Don't draw SGF triangles
--no-circles Don't draw SGF circles
Expand Down
8 changes: 4 additions & 4 deletions src/lib/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const CLAP_STYLES: Styles = Styles::styled()
#[derive(Debug, Parser)]
#[clap(version, about, styles=CLAP_STYLES)]
pub struct SgfRenderArgs {
/// SGF file to render (defaults to stdin).
/// SGF file to render [default: read from stdin].
#[arg(value_name = "FILE")]
pub infile: Option<PathBuf>,
/// Output file. SVG and PNG formats supported.
/// Output file [default: write to stdout].
#[arg(short, long, value_name = "FILE")]
pub outfile: Option<PathBuf>,
/// Output format.
Expand Down Expand Up @@ -54,10 +54,10 @@ pub struct MakeSvgArgs {
/// Range to draw as a pair of corners (e.g. 'cc-ff').
#[arg(short, long)]
range: Option<GobanRange>,
/// Style to use. One of 'simple', 'fancy' or 'minimalist'.
/// Style to use.
#[arg(long = "style", value_name = "STYLE", default_value = "simple")]
generated_style: generated_styles::GeneratedStyle,
/// Custom style to use. Overrides '--style'. See the README for details.
/// Custom style `toml` file. Conflicts with '--style'. See the README for details.
#[arg(long, value_name = "FILE", conflicts_with = "generated_style")]
custom_style: Option<PathBuf>,
/// Draw move numbers (may replace other markup).
Expand Down

0 comments on commit a45d570

Please sign in to comment.