Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/commands/rhoas_request.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions pkg/cmd/request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
20 changes: 20 additions & 0 deletions pkg/core/localize/locales/en/cmd/request.en.toml
Original file line number Diff line number Diff line change
@@ -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
'''