diff --git a/README.md b/README.md index 0492ee1..738321a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 Timeout to read a next line from the stream in milliseconds. [default: 10] diff --git a/src/main.rs b/src/main.rs index 4419d67..cd49659 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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",