Skip to content

Commit

Permalink
fix #652, also fix help that was missing udp-echo, prep for 1.18.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Nov 12, 2022
1 parent b47a640 commit 75efc83
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
26 changes: 14 additions & 12 deletions README.md
Expand Up @@ -52,13 +52,13 @@ You can install from source:
The [releases](https://github.com/fortio/fortio/releases) page has binaries for many OS/architecture combinations (see assets):

```shell
curl -L https://github.com/fortio/fortio/releases/download/v1.38.3/fortio-linux_amd64-1.38.3.tgz \
curl -L https://github.com/fortio/fortio/releases/download/v1.38.4/fortio-linux_amd64-1.38.4.tgz \
| sudo tar -C / -xvzpf -
# or the debian package
wget https://github.com/fortio/fortio/releases/download/v1.38.3/fortio_1.38.3_amd64.deb
dpkg -i fortio_1.38.3_amd64.deb
wget https://github.com/fortio/fortio/releases/download/v1.38.4/fortio_1.38.4_amd64.deb
dpkg -i fortio_1.38.4_amd64.deb
# or the rpm
rpm -i https://github.com/fortio/fortio/releases/download/v1.38.3/fortio-1.38.3-1.x86_64.rpm
rpm -i https://github.com/fortio/fortio/releases/download/v1.38.4/fortio-1.38.4-1.x86_64.rpm
# and more, see assets in release page
```

Expand All @@ -68,7 +68,7 @@ On a MacOS you can also install Fortio using [Homebrew](https://brew.sh/):
brew install fortio
```

On Windows, download https://github.com/fortio/fortio/releases/download/v1.38.3/fortio_win_1.38.3.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt:
On Windows, download https://github.com/fortio/fortio/releases/download/v1.38.4/fortio_win_1.38.4.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt:
```
fortio.exe server
```
Expand Down Expand Up @@ -116,15 +116,17 @@ Full list of command line flags (`fortio help`):
<details>
<!-- use release/updateFlags.sh to update this section -->
<pre>
Φορτίο 1.38.3 usage:
Φορτίο 1.38.4 usage:
fortio command [flags] target
where command is one of: load (load testing), server (starts ui, rest api,
http-echo, redirect, proxies, tcp-echo and grpc ping servers), tcp-echo (only
the tcp-echo server), report (report only UI server), redirect (only the
redirect server), proxies (only the -M and -P configured proxies), grpcping
(grpc client), or curl (single URL debug), or nc (single tcp or udp://
connection), or version (prints the full version and build details).
where target is a url (http load tests) or host:port (grpc health test).
http-echo, redirect, proxies, tcp-echo, udp-echo and grpc ping servers),
tcp-echo (only the tcp-echo server), udp-echo (only udp-echo server),
report (report only UI server), redirect (only the redirect server),
proxies (only the -M and -P configured proxies), grpcping (grpc client),
or curl (single URL debug), or nc (single tcp or udp:// connection),
or version (prints the full version and build details).
where target is a url (http load tests) or host:port (grpc health test),
or tcp://host:port (tcp load test), or udp://host:port (udp load test).
flags are:
-H header
Additional header(s)
Expand Down
22 changes: 12 additions & 10 deletions fortio_main.go
Expand Up @@ -71,16 +71,18 @@ func (f *httpMultiFlagList) Set(value string) error {

// Usage to a writer.
func usage(w io.Writer, msgs ...interface{}) {
_, _ = fmt.Fprintf(w, "Φορτίο %s usage:\n\t%s command [flags] target\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
_, _ = fmt.Fprintf(w, "Φορτίο %s usage:\n\t%s command [flags] target\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
version.Short(),
os.Args[0],
"where command is one of: load (load testing), server (starts ui, rest api,",
" http-echo, redirect, proxies, tcp-echo and grpc ping servers), tcp-echo (only",
" the tcp-echo server), report (report only UI server), redirect (only the",
" redirect server), proxies (only the -M and -P configured proxies), grpcping",
" (grpc client), or curl (single URL debug), or nc (single tcp or udp://",
" connection), or version (prints the full version and build details).",
"where target is a url (http load tests) or host:port (grpc health test).")
" http-echo, redirect, proxies, tcp-echo, udp-echo and grpc ping servers), ",
" tcp-echo (only the tcp-echo server), udp-echo (only udp-echo server),",
" report (report only UI server), redirect (only the redirect server),",
" proxies (only the -M and -P configured proxies), grpcping (grpc client),",
" or curl (single URL debug), or nc (single tcp or udp:// connection),",
" or version (prints the full version and build details).",
"where target is a url (http load tests) or host:port (grpc health test),",
" or tcp://host:port (tcp load test), or udp://host:port (udp load test).")
bincommon.FlagsUsage(w, msgs...)
}

Expand Down Expand Up @@ -248,9 +250,6 @@ func main() {
fnet.UDPEchoServer("udp-echo", *udpPortFlag, *udpAsyncFlag)
startProxies()
case "proxies":
if len(flag.Args()) != 0 {
usageErr("Error: fortio proxies command only takes -P / -M flags")
}
isServer = true
if startProxies() == 0 {
usageErr("Error: fortio proxies command needs at least one -P / -M flag")
Expand Down Expand Up @@ -281,6 +280,9 @@ func main() {
usageErr("Error: unknown command ", command)
}
if isServer {
if len(flag.Args()) != 0 {
usageErr("Error: too many arguments (typo in a flag?)")
}
if confDir == "" {
log.Infof("Note: not using dynamic flag watching (use -config to set watch directory)")
}
Expand Down

0 comments on commit 75efc83

Please sign in to comment.