Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about using stdout #44

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Features:
```
Usage: shotgun [options] [file]

file: use - as [file] for stdout

Options:
-i, --id ID Window to capture
Comment on lines +19 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong.

Options:
-i, --id ID Window to capture
-g, --geometry WxH+X+Y
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ 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]
\n file: use - as [file] for stdout");
let usage = opts.usage(&brief);
Comment on lines +26 to 28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does opts not have a way to document free-standing options? Abusing the brief for that is weird as getopts likely won't be able to do any layout on it.

eprint!("{usage}");
}
Expand Down