Update CLI help

This commit is contained in:
Tim Visée
2017-12-31 20:25:31 +01:00
parent 4776ca83b4
commit 316fb11b4c
6 changed files with 40 additions and 27 deletions

View File

@@ -83,20 +83,20 @@ Tim Visee <timvisee@gmail.com>
A quick pixelflut client, that pwns pixelflut panels. A quick pixelflut client, that pwns pixelflut panels.
USAGE: USAGE:
pixelpwnr [OPTIONS] <HOST> --images <PATH>... pixelpwnr [OPTIONS] <HOST> --image <PATH>...
FLAGS: FLAGS:
--help Prints help information --help Prints help information
-V, --version Prints version information -V, --version Prints version information
OPTIONS: OPTIONS:
-c, --count <COUNT> Number of simultanious threads (def: 4) -i, --image <PATH>... Image paths
-w, --width <PIXELS> Draw width (def: 1920)
-h, --height <PIXELS> Draw height (def: 1080)
-x, --x <PIXELS> Draw X offset (def: 0)
-y, --y <PIXELS> Draw Y offset (def: 0)
-c, --count <COUNT> Number of concurrent threads (def: 4)
-r, --fps <RATE> Frames per second with multiple images (def: 1) -r, --fps <RATE> Frames per second with multiple images (def: 1)
-h, --height <PIXELS> Drawing height in pixels (def: 1080)
-i, --images <PATH>... Paths of the images to print
-w, --width <PIXELS> Drawing width in pixels (def: 1920)
-x, --x <PIXELS> Drawing X offset in pixels (def: 0)
-y, --y <PIXELS> Drawing Y offset in pixels (def: 0)
ARGS: ARGS:
<HOST> The host to pwn "host:port" <HOST> The host to pwn "host:port"

View File

@@ -1,5 +1,6 @@
# TODO # TODO
- Do not draw invisible pixels. - Don't draw pixels outside screen.
- Do not draw invisible (alpha) pixels.
- Read size from screen. - Read size from screen.
- Instantly update images in painter threads, - Instantly update images in painter threads,
not just when the stopped drawing. not just when the stopped drawing.

View File

@@ -24,49 +24,59 @@ impl<'a: 'b, 'b> ArgHandler<'a> {
.help("The host to pwn \"host:port\"") .help("The host to pwn \"host:port\"")
.required(true) .required(true)
.index(1)) .index(1))
.arg(Arg::with_name("count")
.short("c")
.long("count")
.value_name("COUNT")
.help("Number of simultanious threads (def: 4)")
.takes_value(true))
.arg(Arg::with_name("image") .arg(Arg::with_name("image")
.short("i") .short("i")
.long("images") .long("image")
.alias("images")
.value_name("PATH") .value_name("PATH")
.help("Paths of the images to print") .help("Image paths")
.required(true) .required(true)
.multiple(true) .multiple(true)
.display_order(1)
.takes_value(true)) .takes_value(true))
.arg(Arg::with_name("width") .arg(Arg::with_name("width")
.short("w") .short("w")
.long("width") .long("width")
.value_name("PIXELS") .value_name("PIXELS")
.help("Drawing width in pixels (def: 1920)") .help("Draw width ((def: 1920)")
.display_order(2)
.takes_value(true)) .takes_value(true))
.arg(Arg::with_name("height") .arg(Arg::with_name("height")
.short("h") .short("h")
.long("height") .long("height")
.value_name("PIXELS") .value_name("PIXELS")
.help("Drawing height in pixels (def: 1080)") .help("Draw height (def: 1080)")
.display_order(3)
.takes_value(true)) .takes_value(true))
.arg(Arg::with_name("x") .arg(Arg::with_name("x")
.short("x") .short("x")
.long("x") .long("x")
.value_name("PIXELS") .value_name("PIXELS")
.help("Drawing X offset in pixels (def: 0)") .help("Draw X offset(def: 0)")
.display_order(4)
.takes_value(true)) .takes_value(true))
.arg(Arg::with_name("y") .arg(Arg::with_name("y")
.short("y") .short("y")
.long("y") .long("y")
.value_name("PIXELS") .value_name("PIXELS")
.help("Drawing Y offset in pixels (def: 0)") .help("Draw Y offset (def: 0)")
.display_order(5)
.takes_value(true))
.arg(Arg::with_name("count")
.short("c")
.long("count")
.alias("thread")
.alias("threads")
.value_name("COUNT")
.help("Number of concurrent threads (def: 4)")
.display_order(6)
.takes_value(true)) .takes_value(true))
.arg(Arg::with_name("fps") .arg(Arg::with_name("fps")
.short("r") .short("r")
.long("fps") .long("fps")
.value_name("RATE") .value_name("RATE")
.help("Frames per second with multiple images (def: 1)") .help("Frames per second with multiple images (def: 1)")
.display_order(7)
.takes_value(true)) .takes_value(true))
.get_matches(); .get_matches();

View File

@@ -12,7 +12,7 @@ impl Color {
/// Constructor. /// Constructor.
/// ///
/// The Red, Green and Blue values must be between 0 and 255. /// The color channels must be between 0 and 255.
pub fn from(r: u8, g: u8, b: u8) -> Color { pub fn from(r: u8, g: u8, b: u8) -> Color {
Color { Color {
r, r,

View File

@@ -39,6 +39,8 @@ impl ImageManager {
.collect() .collect()
); );
// TODO: process the image slices
// We succeeded // We succeeded
println!("All images have been loaded successfully"); println!("All images have been loaded successfully");