From e3259e9721e4d1df93a1022eba99fb8b8e00df22 Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Sun, 20 Aug 2023 07:03:59 -0600 Subject: [PATCH 1/5] stdout help --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index bfd04ca..ac5de40 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,7 @@ mod xwrap; use crate::xwrap::Display; fn usage(progname: &str, opts: getopts::Options) { - let brief = format!("Usage: {progname} [options] [file]"); + let brief = format!("Usage: {progname} [options] [file]\nNote: use - as [file] for stdout"); let usage = opts.usage(&brief); eprint!("{usage}"); } From 2bf75f80efffe9c5949a73df7321cf0514c49d15 Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Thu, 31 Aug 2023 23:39:35 -0600 Subject: [PATCH 2/5] Added manpage Added manpage using groff markdown using the man macro. Using `groff -Tascii -man shotgun.man` to transpile. --- shotgun.man | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 shotgun.man diff --git a/shotgun.man b/shotgun.man new file mode 100644 index 0000000..51e756f --- /dev/null +++ b/shotgun.man @@ -0,0 +1,38 @@ +.TH shotgun 1 "08/31/2023" "2.5.1" "User Commands" +.SH NAME +shotgun \- Minimal X screenshot utility +.SH SYNOPSIS +shotgun [\fIOPTIONS\fP] [\fIFILE\fP] +.SH DESCRIPTION +A minimal screenshot utility for X11. +.SS SUPPORTS +.TP +Exporting to PNG/STDOUT +.TP +Masksing off-screen areas on multi-head setups +.TP +Selecting by window ID and geometry +.SS OPTIONS +.TP +\fB-i, --id\fP ID +Window to capture +.TP +\fB-g, --geometry\fP WxH+X+Y +Area to capture +.TP +\fB-f, --format\fP +Either png/pam as output format +.TP +\fB-s, --screen\fP +Capture the current screen +.TP +\fB-h, --help\fP +Print help and exit +.TP +\fB-v, --version\fP +Print version and exit +.SH FILE +\fIfile\fP can be either a file name of which you would like to save the image to, or when using the "-" charicter as the file name it will pipe the image to STDOUT. +.SH AUTHOR +neXromancers + From 80aa266532f00af0c2ddcada328c56d59a5c9186 Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Fri, 1 Sep 2023 01:19:10 -0600 Subject: [PATCH 3/5] Created a manpage This page can be viewed using the `man` command, thus giving you the program's manual. --- shotgun.man => docs/shotgun.1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename shotgun.man => docs/shotgun.1 (84%) diff --git a/shotgun.man b/docs/shotgun.1 similarity index 84% rename from shotgun.man rename to docs/shotgun.1 index 51e756f..8ba2757 100644 --- a/shotgun.man +++ b/docs/shotgun.1 @@ -1,5 +1,5 @@ -.TH shotgun 1 "08/31/2023" "2.5.1" "User Commands" -.SH NAME +.TH SHOTGUN 1 "08/31/2023" "2.5.1" "User Commands" +.SH SHOTGUN shotgun \- Minimal X screenshot utility .SH SYNOPSIS shotgun [\fIOPTIONS\fP] [\fIFILE\fP] @@ -35,4 +35,5 @@ Print version and exit \fIfile\fP can be either a file name of which you would like to save the image to, or when using the "-" charicter as the file name it will pipe the image to STDOUT. .SH AUTHOR neXromancers - +.SH BUGS +Please report bugs here: https://github.com/neXromancers/shotgun/issues From 52130b37756efb709aa610d0a76e86e7459c3807 Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Fri, 1 Sep 2023 01:21:01 -0600 Subject: [PATCH 4/5] Updated README to mention the avaliablility of a man page. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 842609e..b696da4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Features: - *On average, shotgun is more than twice as fast as maim* ## Usage +See the man page: `docs/shotgun.1`. ``` Usage: shotgun [options] [file] From 00580d1ed39b153d4010cbacd28d6fc615bfbd97 Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Fri, 1 Sep 2023 22:52:25 -0600 Subject: [PATCH 5/5] Changed helptext Also removed manpage from this PR --- README.md | 5 ++++- docs/shotgun.1 | 39 --------------------------------------- src/main.rs | 3 ++- 3 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 docs/shotgun.1 diff --git a/README.md b/README.md index b696da4..45dd8cf 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,14 @@ Features: - *On average, shotgun is more than twice as fast as maim* ## Usage -See the man page: `docs/shotgun.1`. ``` Usage: shotgun [options] [file] + file: use - as [file] for stdout + +Options: + -i, --id ID Window to capture Options: -i, --id ID Window to capture -g, --geometry WxH+X+Y diff --git a/docs/shotgun.1 b/docs/shotgun.1 deleted file mode 100644 index 8ba2757..0000000 --- a/docs/shotgun.1 +++ /dev/null @@ -1,39 +0,0 @@ -.TH SHOTGUN 1 "08/31/2023" "2.5.1" "User Commands" -.SH SHOTGUN -shotgun \- Minimal X screenshot utility -.SH SYNOPSIS -shotgun [\fIOPTIONS\fP] [\fIFILE\fP] -.SH DESCRIPTION -A minimal screenshot utility for X11. -.SS SUPPORTS -.TP -Exporting to PNG/STDOUT -.TP -Masksing off-screen areas on multi-head setups -.TP -Selecting by window ID and geometry -.SS OPTIONS -.TP -\fB-i, --id\fP ID -Window to capture -.TP -\fB-g, --geometry\fP WxH+X+Y -Area to capture -.TP -\fB-f, --format\fP -Either png/pam as output format -.TP -\fB-s, --screen\fP -Capture the current screen -.TP -\fB-h, --help\fP -Print help and exit -.TP -\fB-v, --version\fP -Print version and exit -.SH FILE -\fIfile\fP can be either a file name of which you would like to save the image to, or when using the "-" charicter as the file name it will pipe the image to STDOUT. -.SH AUTHOR -neXromancers -.SH BUGS -Please report bugs here: https://github.com/neXromancers/shotgun/issues diff --git a/src/main.rs b/src/main.rs index ac5de40..1ff3d88 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,8 @@ mod xwrap; use crate::xwrap::Display; fn usage(progname: &str, opts: getopts::Options) { - let brief = format!("Usage: {progname} [options] [file]\nNote: use - as [file] for stdout"); + let brief = format!("Usage: {progname} [options] [file] + \n file: use - as [file] for stdout"); let usage = opts.usage(&brief); eprint!("{usage}"); }