Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pforemski committed Oct 25, 2023
1 parent 198d732 commit 8358c8c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ Usage: bgpipe [OPTIONS] [--] STAGE [STAGE-OPTIONS] [STAGE-ARGUMENTS...] [--] ...
Options:
-l, --log string log level (debug/info/warn/error/disabled) (default "info")
-D, --debug alias for --log debug
-e, --events strings log given pipe events (asterisk means all) (default [PARSE,ESTABLISHED])
-e, --events strings log given events ("all" means all events) (default [PARSE,ESTABLISHED])
-i, --stdin read stdin after session is established (unless explicitly configured)
-s, --silent do not write stdout (unless explicitly configured)
-r, --reverse reverse the pipe
-r, --reverse reverse the pipe direction
-2, --short-asn use 2-byte ASN numbers
Supported stages (run stage -h to get its help)
Expand All @@ -50,7 +50,7 @@ Supported stages (run stage -h to get its help)
# see docs for "connect" stage
$ bgpipe connect -h
Stage usage: connect [OPTIONS] TARGET
Stage usage: connect [OPTIONS] ADDR
connect to a TCP endpoint
Expand All @@ -59,11 +59,9 @@ Options:
-R, --right operate in R direction
-W, --wait strings wait for given event before starting
-S, --stop strings stop after given event is handled
-I, --in string where to inject new messages (default "next")
--timeout duration connect timeout (0 means none)
--md5 string TCP MD5 password
Events:
connected connection established
```

## Examples
Expand Down Expand Up @@ -93,6 +91,12 @@ $ bgpipe \
-- speaker --active --asn 65055 \
-- mrt --wait ESTABLISHED updates.20230301.0000.bz2 \
-- listen :179

# a BGP sed-in-the-middle proxy rewriting ASNs in OPEN messages
$ bgpipe \
-- connect 1.2.3.4 \
-- exec -LR -c sed -ure '/"OPEN"/{ s/65055/65001/g; s/57355/65055/g }' \
-- connect 85.232.240.179
```

## Author
Expand Down
4 changes: 2 additions & 2 deletions pkg/bgpipe/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func (b *Bgpipe) addFlags() {
f.SetInterspersed(false)
f.StringP("log", "l", "info", "log level (debug/info/warn/error/disabled)")
f.BoolP("debug", "D", false, "alias for --log debug")
f.StringSliceP("events", "e", []string{"PARSE", "ESTABLISHED"}, "log given pipe events (use \"all\" to log all events)")
f.StringSliceP("events", "e", []string{"PARSE", "ESTABLISHED"}, "log given events (\"all\" means all events)")
f.BoolP("stdin", "i", false, "read stdin after session is established (unless explicitly configured)")
f.BoolP("silent", "s", false, "do not write stdout (unless explicitly configured)")
f.BoolP("reverse", "r", false, "reverse the pipe")
f.BoolP("reverse", "r", false, "reverse the pipe direction")
f.BoolP("short-asn", "2", false, "use 2-byte ASN numbers")
}

Expand Down

0 comments on commit 8358c8c

Please sign in to comment.