diff --git a/docs/commands/rhoas_request.md b/docs/commands/rhoas_request.md index 8fa3221cce..69d37ab041 100644 --- a/docs/commands/rhoas_request.md +++ b/docs/commands/rhoas_request.md @@ -6,6 +6,7 @@ Allows you to perform API requests against the API server Command allows users you to perform API requests against the API server. + ``` rhoas request [flags] ``` @@ -13,12 +14,12 @@ rhoas request [flags] ### Examples ``` +# Perform a GET request to the specified path +rhoas request --path /api/kafkas_mgmt/v1/kafkas + +# Perform a POST request to the specified path +# cat request.json | rhoas request --path "/api/kafkas_mgmt/v1/kafkas?async=true" --method post - # Perform a GET request to the specified path - rhoas request --path /api/kafkas_mgmt/v1/kafkas - - # Perform a POST request to the specified path - # cat request.json | rhoas request --path "/api/kafkas_mgmt/v1/kafkas?async=true" --method post ``` ### Options diff --git a/pkg/cmd/request/request.go b/pkg/cmd/request/request.go index 909e871747..6a8c0778a8 100644 --- a/pkg/cmd/request/request.go +++ b/pkg/cmd/request/request.go @@ -34,16 +34,11 @@ func NewCallCmd(f *factory.Factory) *cobra.Command { } cmd := &cobra.Command{ - Use: "request", - Short: "Allows you to perform API requests against the API server", - Long: "Command allows users you to perform API requests against the API server.", - Example: ` - # Perform a GET request to the specified path - rhoas request --path /api/kafkas_mgmt/v1/kafkas - - # Perform a POST request to the specified path - # cat request.json | rhoas request --path "/api/kafkas_mgmt/v1/kafkas?async=true" --method post `, - Args: cobra.NoArgs, + Use: "request", + Short: f.Localizer.MustLocalize("request.cmd.shortDescription"), + Long: f.Localizer.MustLocalize("request.cmd.longDescription"), + Example: f.Localizer.MustLocalize("request.cmd.example"), + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runCmd(opts) }, diff --git a/pkg/core/localize/locales/en/cmd/request.en.toml b/pkg/core/localize/locales/en/cmd/request.en.toml new file mode 100644 index 0000000000..0f84d769d8 --- /dev/null +++ b/pkg/core/localize/locales/en/cmd/request.en.toml @@ -0,0 +1,20 @@ +[request.cmd.shortDescription] +description = "Short description for command" +one = "Allows you to perform API requests against the API server" + +[request.cmd.longDescription] +description = "Long description for command" +one = ''' +Command allows users you to perform API requests against the API server. +''' + +[request.cmd.example] +description = 'Examples of how to use the command' +one = ''' +# Perform a GET request to the specified path +rhoas request --path /api/kafkas_mgmt/v1/kafkas + +# Perform a POST request to the specified path +# cat request.json | rhoas request --path "/api/kafkas_mgmt/v1/kafkas?async=true" --method post +''' +