Skip to content

Resolves #10 - Add resource-list command#40

Merged
steve-r-west merged 2 commits intomainfrom
feature/resource-list
Apr 1, 2022
Merged

Resolves #10 - Add resource-list command#40
steve-r-west merged 2 commits intomainfrom
feature/resource-list

Conversation

@jccl
Copy link
Copy Markdown
Collaborator

@jccl jccl commented Apr 1, 2022

Added the resource-list command. This implementation does not right-align the URLs of each CRUD operation, which was originally done in the Bash version since the formatting looks weird when there are long URLs + long commands.

@jccl
Copy link
Copy Markdown
Collaborator Author

jccl commented Apr 1, 2022

Output looks somthing like

$ ./epcc-cli resource-list
account-authentication-settings => json-type: account-authentication-settings
        epcc-cli get account-authentication-settings                                    ==> /v2/settings/account-authentication
        epcc-cli get account-authentication-settings                                    ==> /v2/settings/account-authentication

account-management-authentication-tokens => json-type: account_management_authentication_token
        epcc-cli create account-management-authentication-tokens                        ==> /v2/account-members/tokens

account-members => json-type: account-member
        epcc-cli get account-members                                                    ==> /v2/account-members
        epcc-cli get account-members [ID]                                               ==> /v2/account-members/%1
        epcc-cli delete account-members [ID]                                            ==> /v2/account-members/%1

Comment thread cmd/resourcelist.go Outdated
"github.com/spf13/cobra"
)

func printCrudCommands(programName, operation, resource, url string) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this for anything?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm an idiot.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this below the cobra.Command() though.

I think I'm of the opinion, that the more general things should be at the top of the file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, will do

@steve-r-west steve-r-west merged commit f9d707a into main Apr 1, 2022
@steve-r-west steve-r-west deleted the feature/resource-list branch April 1, 2022 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants