Skip to content

Commit

Permalink
docs(readme): fix the readme
Browse files Browse the repository at this point in the history
Signed-off-by: Christina Sørensen <[email protected]>
  • Loading branch information
cafkafk committed Sep 24, 2023
1 parent 3c41658 commit dd636f4
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
> **Warning**
> This program is WIP
This Rust project is designed to extract command-line flags from input and generate a powerset of those flags up to a specified depth. The resulting subsets are then prefixed with a constant string and printed to the console.
Powerset is a simple Rust binary (and perhaps future library), that takes a
configuration file specifying commands and uses it to produce a powerset of
those commands. This helps easily generate tests from a single source of truth,
allowing your tests to be initialized at any time from the declarative
configuration.

## Features
Historically, it would parse the output of a binary via a regex. Currently,
it's being refactored to generate configurations from this parsing, but
primarily being dependent on the actual configuration first and foremost.

Extract short (-f) and long (--flag) command-line flags from input.
Generate a powerset of the extracted flags up to a specified depth.
Prefix each subset in the powerset with a constant string (eza by default).
This program was created for eza, but eventually, it should be usable more
broadly.

## Usage

Expand All @@ -18,24 +23,6 @@ Compile the Rust program:
```bash
cargo build --release
```
Run the compiled binary and provide the input:

```bash
echo "-a, --all... -l, --long..." | ./target/release/your_binary_name
```

Replace `your_binary_name` with the appropriate name of your compiled binary.

The program will print the output strings, each prefixed with the constant string and containing a subset of the extracted flags.

# Configuration

`DEPTH`: Adjust this constant to set the maximum size of the subsets in the powerset. Default is `2`.
`BINARY`: This constant string is prefixed to each subset in the powerset. Default is `eza`.

# Dependencies

`regex`: This crate is used for extracting flags from the input using regular expressions.

# Contribution

Expand Down

0 comments on commit dd636f4

Please sign in to comment.