Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add flags to charmil crud commands #186

Merged
merged 1 commit into from
Jul 27, 2021

Conversation

namit-chandwani
Copy link
Member

Closes #178

Description

Added flags to the Charmil CRUD commands.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

@namit-chandwani namit-chandwani requested a review from a team July 27, 2021 13:22
@@ -26,6 +29,10 @@ func NewCreateCommand(f *factory.Factory) *cobra.Command {
},
}

// Adds local flags
cmd.Flags().StringVarP(&opts.outputFormat, "output", "o", "json", f.Localizer.LocalizeByID("crud.cmd.flag.output.description"))
Copy link
Contributor

Choose a reason for hiding this comment

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

how is this replaced?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, didn't get you. Can you please elaborate? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

crud.cmd.flag how is that replaced to commandName.cmd.flag etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we don't need to replace that with the command name (since these values are not being extracted from the main locale file in CLI, instead an additional locale file named crud.en.yaml is being generated for the same).

Through PR #172, I have included a separate locale file as a template for CRUD commands (Link to the locale template file).

This locale file even contains entries for every flag that is present in the CRUD commands (including crud.cmd.flag.output.description).

Whenever the charmil crud command is run, those 5 CRUD files will be generated in the path specified by user whereas this locale file will be generated in the locales/en directory of the CLI.

Copy link
Contributor

Choose a reason for hiding this comment

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

That needs to be fixed

@wtrocki wtrocki merged commit 1b65d54 into main Jul 27, 2021
@wtrocki wtrocki deleted the feature/charmil-cli/add-flags-to-crud-commands branch July 27, 2021 16:22
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.

Add flags to Charmil CRUD generator templates
2 participants