Skip to content

Commit

Permalink
Update flag usage messages to include whether the arguments are requi…
Browse files Browse the repository at this point in the history
…red or optional in the tcpdup tool.
  • Loading branch information
skywind3000 committed Dec 23, 2024
1 parent 8613756 commit db20f20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ tcpdup -listen 0.0.0.0:8080 -target 192.168.1.100:8080 \
```text
Usage of ./tcpdup:
-listen
local address, eg: 0.0.0.0:8080
local address (required), eg: 0.0.0.0:8080
-target
destination address, eg: 8.8.8.8:8080
destination address (required), eg: 8.8.8.8:8080
-input
input duplication address, eg: 127.0.0.1:8081
input duplication address (optional), eg: 127.0.0.1:8081
-output
output duplication address, eg: 127.0.0.1:8082
output duplication address (optional), eg: 127.0.0.1:8082
```

## Credit
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func start(listen string, target string, input string, output string) int {
}

func main() {
listen := flag.String("listen", "", "local address, eg: 0.0.0.0:8080")
target := flag.String("target", "", "destination address, eg: 8.8.8.8:8080")
input := flag.String("input", "", "input duplication address, eg: 127.0.0.1:8081")
output := flag.String("output", "", "output duplication address, eg: 127.0.0.1:8082")
listen := flag.String("listen", "", "local address (required), eg: 0.0.0.0:8080")
target := flag.String("target", "", "destination address (required), eg: 8.8.8.8:8080")
input := flag.String("input", "", "input duplication address (optional), eg: 127.0.0.1:8081")
output := flag.String("output", "", "output duplication address (optional), eg: 127.0.0.1:8082")
flag.Usage = func() {
flagSet := flag.CommandLine
fmt.Printf("Usage of %s:\n", os.Args[0])
Expand Down

0 comments on commit db20f20

Please sign in to comment.