Skip to content

Commit

Permalink
update readme about examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Jun 1, 2024
1 parent fa826e0 commit 0db6dda
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ in
}
```

## Examples

```bash
stern --context kind-kind etcd |& sig
# or
sig --cmd "stern --context kind-kind etcd" # this is able to retry command by ctrl+r.
```

### Archived mode

```bash
cat README.md |& sig -a
# or
sig -a --cmd "cat README.md"
```

## Keymap

| Key | Action
Expand Down Expand Up @@ -120,6 +136,17 @@ Interactive grep (for streaming)

Usage: sig [OPTIONS]

Examples:

$ stern --context kind-kind etcd |& sig
Or the method to retry command by pressing ctrl+r:
$ sig --cmd "stern --context kind-kind etcd"

Archived mode:
$ cat README.md |& sig -a
Or
$ sig -a --cmd "cat README.md"

Options:
--retrieval-timeout <RETRIEVAL_TIMEOUT_MILLIS>
Timeout to read a next line from the stream in milliseconds. [default: 10]
Expand Down
23 changes: 23 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@ pub enum Signal {
/// Interactive grep (for streaming)
#[derive(Parser)]
#[command(name = "sig", version)]
#[command(
name = "sig",
version,
help_template = "
{about}
Usage: {usage}
Examples:
$ stern --context kind-kind etcd |& sig
Or the method to retry command by pressing ctrl+r:
$ sig --cmd \"stern --context kind-kind etcd\"
Archived mode:
$ cat README.md |& sig -a
Or
$ sig -a --cmd \"cat README.md\"
Options:
{options}
"
)]
pub struct Args {
#[arg(
long = "retrieval-timeout",
Expand Down

0 comments on commit 0db6dda

Please sign in to comment.