Skip to content

Commit 779d5e9

Browse files
authored
Merge pull request #65 from aykhans/refactor/rename-cli-flags
🔨 Rename CLI flags
2 parents ca6b3d4 + 6a79d0b commit 779d5e9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ You can find an example config structure in the [config.json](https://github.com
6060
"url": "https://example.com",
6161
"no_proxy_check": false,
6262
"timeout": 2000,
63-
"dodos_count": 10,
64-
"request_count": 1000,
63+
"dodos": 10,
64+
"requests": 1000,
6565
"params": {},
6666
"headers": {},
6767
"cookies": {},
@@ -108,8 +108,8 @@ If the Headers, Params, Cookies and Body fields have multiple values, each reque
108108
| Yes | - | --yes | -y | Boolean | Answer yes to all questions | false |
109109
| URL | url | --url | -u | String | URL to send the request to | - |
110110
| Method | method | --method | -m | String | HTTP method | GET |
111-
| Request count | request_count | --request-count | -r | Integer | Total number of requests to send | 1000 |
112-
| Dodos count (Threads) | dodos_count | --dodos-count | -d | Integer | Number of dodos (threads) to send requests in parallel | 1 |
111+
| Requests | requests | --requests | -r | Integer | Total number of requests to send | 1000 |
112+
| Dodos (Threads) | dodos | --dodos | -d | Integer | Number of dodos (threads) to send requests in parallel | 1 |
113113
| Timeout | timeout | --timeout | -t | Integer | Timeout for canceling each request (milliseconds) | 10000 |
114114
| No Proxy Check | no_proxy_check | --no-proxy-check| - | Boolean | Disable proxy check | false |
115115
| Params | params | - | - | Key-Value {String: [String]} | Request parameters | - |

config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"url": "https://example.com",
44
"no_proxy_check": false,
55
"timeout": 10000,
6-
"dodos_count": 1,
7-
"request_count": 1,
6+
"dodos": 1,
7+
"requests": 1,
88
"params": {},
99
"headers": {},
1010
"cookies": {},

config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
VERSION string = "0.5.501"
15+
VERSION string = "0.5.502"
1616
DefaultUserAgent string = "Dodo/" + VERSION
1717
ProxyCheckURL string = "https://www.google.com"
1818
DefaultMethod string = "GET"
@@ -107,8 +107,8 @@ type Config struct {
107107
Method string `json:"method" validate:"http_method"` // custom validations: http_method
108108
URL string `json:"url" validate:"http_url,required"`
109109
Timeout uint32 `json:"timeout" validate:"gte=1,lte=100000"`
110-
DodosCount uint `json:"dodos_count" validate:"gte=1"`
111-
RequestCount uint `json:"request_count" validation_name:"request-count" validate:"gte=1"`
110+
DodosCount uint `json:"dodos" validate:"gte=1"`
111+
RequestCount uint `json:"requests" validation_name:"request-count" validate:"gte=1"`
112112
NoProxyCheck Option[bool] `json:"no_proxy_check"`
113113
}
114114

readers/cli.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Flags:
2828
-h, --help help for dodo
2929
-v, --version version for dodo
3030
-c, --config-file string Path to the config file
31-
-d, --dodos-count uint Number of dodos(threads) (default %d)
31+
-d, --dodos uint Number of dodos(threads) (default %d)
3232
-m, --method string HTTP Method (default %s)
33-
-r, --request-count uint Number of total requests (default %d)
33+
-r, --request uint Number of total requests (default %d)
3434
-t, --timeout uint32 Timeout for each request in milliseconds (default %d)
3535
-u, --url string URL for stress testing
3636
--no-proxy-check bool Do not check for proxies (default false)
@@ -74,10 +74,10 @@ func CLIConfigReader() (*config.CLIConfig, error) {
7474
flag.StringVar(&url, "url", "", "URL to send the request")
7575
flag.StringVar(&url, "u", "", "URL to send the request")
7676

77-
flag.UintVar(&dodosCount, "dodos-count", 0, "Number of dodos(threads)")
77+
flag.UintVar(&dodosCount, "dodos", 0, "Number of dodos(threads)")
7878
flag.UintVar(&dodosCount, "d", 0, "Number of dodos(threads)")
7979

80-
flag.UintVar(&requestsCount, "requests-count", 0, "Number of total requests")
80+
flag.UintVar(&requestsCount, "requests", 0, "Number of total requests")
8181
flag.UintVar(&requestsCount, "r", 0, "Number of total requests")
8282

8383
flag.UintVar(&timeout, "timeout", 0, "Timeout for each request in milliseconds")
@@ -107,9 +107,9 @@ func CLIConfigReader() (*config.CLIConfig, error) {
107107
cliConfig.Method = method
108108
case "url", "u":
109109
cliConfig.URL = url
110-
case "dodos-count", "d":
110+
case "dodos", "d":
111111
cliConfig.DodosCount = dodosCount
112-
case "requests-count", "r":
112+
case "requests", "r":
113113
cliConfig.RequestCount = requestsCount
114114
case "timeout", "t":
115115
var maxUint32 uint = 4294967295

0 commit comments

Comments
 (0)