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 man page #8

Merged
merged 2 commits into from
Jun 16, 2022
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docs

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get install scdoc
- name: Build
run: make docs
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/target
**/*.rs.bk
contrib/*.1
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docs: contrib/progpick.1

contrib/%.1: contrib/%.1.scd
scdoc < $^ > $@
77 changes: 77 additions & 0 deletions contrib/progpick.1.scd
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
progpick(1)

# NAME

progpick - Bruteforce with a stream of permutations of a specific pattern

# SYNOPSIS

*progpick* [-vqc] [-e _cmd_] _PATTERN_

# DESCRIPTION

*progpick* is a program to generate permutations of an explicitly provided
pattern. It's useful if you forgot some details about a passphrase but you
still remember most of it.

# OPTIONS

*-v*, *--verbose*
Verbose logs (can be used multiple times, maximum: 4)

*-q*, *--quiet*
Do not print progress bar

*-c*, *--count*
Count total number of permutations instead of printing them

*-e* _cmd_, *--exec* _cmd_
Send permutations to stdin of a subprocess. _cmd_ is parsed into a list of
arguments and then executed directly instead of going through /bin/sh, so
shell quoting works, but other shell features don't.

*-h*, *--help*
Prints help information.

# EXAMPLES

Generate all combinations from a-z with a length of 5

*progpick '{a..z}{a..z}{a..z}{a..z}{a..z}'*

With progress bar

*progpick '{a..z}{a..z}{a..z}{a..z}{a..z}' > /dev/null*

Without progress bar

*progpick -q '{a..z}{a..z}{a..z}{a..z}{a..z}' > /dev/null*

To make a character optional

*progpick '{a..z}{{a..z},}'*

From a-z and 0-9

*progpick '{{a..z},{0..9}}'*

Run a script for each result

*progpick 'a{b,c{d,e{f,g}}}' | while read -r x; do*
*./script "$x"*
*done*

Send the result to stdin of a script

*progpick -e './script.sh' 'a{b,c{d,e{f,g}}}'*

Attempt to open a luks partition

*sudo progpick -e 'cryptsetup open --test-passphrase /dev/sdc1' 'a{b,c{d,e{f,g}}}'*

# AUTHORS

This program was originally written and is currently maintained by kpcyrd.
Bug reports and patches are welcome on github:

_https://github.com/kpcyrd/progpick_
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ mod tokens;

#[derive(Debug, Parser)]
pub struct Args {
/// Verbose logs (can be used multiple times)
/// Verbose logs (can be used multiple times, maximum: 4)
#[clap(short, long, parse(from_occurrences))]
verbose: u8,
/// Count options instead of printing them
/// Count total number of permutations instead of printing them
#[clap(short = 'c', long = "count")]
count: bool,
/// Do not print progress bar
#[clap(short = 'q', long = "quiet")]
quiet: bool,
/// Send permutations to a subprocess (arguments are supported but shell syntax is not)
/// Send permutations to stdin of a subprocess
#[clap(short = 'e', long = "exec")]
exec: Option<String>,
pattern: Pattern,
Expand Down