Skip to content

Commit

Permalink
Update help text formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
expectocode committed Mar 29, 2020
1 parent 315de3b commit 7ca61f7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "hacksaw"
description = "Lightweight selection tool for usage in screenshot scripts etc."
version = "1.0.1"
version = "1.0.2"
authors = ["expectocode <expectocode@gmail.com>"]
license-file = "LICENSE.txt"
repository = "https://github.com/neXromancers/hacksaw.git"
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ hacksaw -n | {
### Usage

```
hacksaw 0.1.0
expectocode <expectocode@gmail.com>
USAGE:
hacksaw [FLAGS] [OPTIONS]
Expand All @@ -108,15 +105,21 @@ FLAGS:
OPTIONS:
-f, --format <format>
Output format. You can use %x for x-coordinate, %y for y-coordinate, %w for width, %h for height, %i for
selected window id, %g as a shorthand for %wx%h+%x+%y (the default, X geometry) and %% for a literal '%'.
Output format. You can use:
%x for x-coordinate,
%y for y-coordinate,
%w for width,
%h for height,
%i for selected window id,
%g as a shorthand for %wx%h+%x+%y (X geometry),
%% for a literal '%'.
Other %-codes will cause an error. [default: %g]
-g, --guide-thickness <guide_thickness> Thickness of fighter pilot guide lines [default: 1]
-c, --colour <line_colour>
-g, --guide-thickness <guide-thickness> Thickness of fighter pilot guide lines [default: 1]
-c, --colour <line-colour>
Hex colour of the lines (RGB or RGBA), '#' optional [default: #7f7f7f]
-r, --remove-decorations <remove_decorations>
-r, --remove-decorations <remove-decorations>
Number of (nested) window manager frames to try and remove [default: 0]
-s, --select-thickness <select_thickness> Thickness of selection box lines [default: 1]
-s, --select-thickness <select-thickness> Thickness of selection box lines [default: 1]
```
15 changes: 11 additions & 4 deletions src/lib/parse_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::parse_format::{parse_format_string, Format};
use structopt::StructOpt;

#[derive(StructOpt, Debug)]
#[structopt(name = "hacksaw")]
#[structopt(name = "hacksaw", max_term_width = 80)]
pub struct Opt {
#[structopt(
short = "n",
Expand Down Expand Up @@ -42,9 +42,16 @@ pub struct Opt {
default_value = "%g",
parse(try_from_str = parse_format_string),
allow_hyphen_values = true,
help = "Output format. You can use %x for x-coordinate, %y for y-coordinate, %w for width, \
%h for height, %i for selected window id, %g as a shorthand for %wx%h+%x+%y (the \
default, X geometry) and %% for a literal '%'. Other %-codes will cause an error."
help = "\
Output format. You can use:
%x for x-coordinate,
%y for y-coordinate,
%w for width,
%h for height,
%i for selected window id,
%g as a shorthand for %wx%h+%x+%y (X geometry),
%% for a literal '%'.
Other %-codes will cause an error."
)]
pub format: Format,

Expand Down

0 comments on commit 7ca61f7

Please sign in to comment.