Skip to content

Commit dfe0496

Browse files
committed
update directory and file_types
directory and file_types should only be on the files command and now don't need to be persistent flags
1 parent b6297dd commit dfe0496

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

digestabotctl/cmd/files.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ var requiredPRFlags = []string{
3030

3131
func init() {
3232
updateCmd.AddCommand(filesCmd)
33+
fileFlags(filesCmd)
34+
bindFileFlags(filesCmd)
3335
}
3436

3537
func validateFiles(cmd *cobra.Command, args []string) error {

digestabotctl/cmd/flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func bindFileFlags(cmd *cobra.Command) {
3636

3737
// fileFlags adds the file flags to the passed in command
3838
func fileFlags(cmd *cobra.Command) {
39-
cmd.PersistentFlags().StringSliceP("file-types", "f", digestabot.DefaultFileTypes, "Files to update")
40-
cmd.PersistentFlags().StringP("directory", "d", ".", "Directory to update files")
39+
cmd.Flags().StringSliceP("file-types", "f", digestabot.DefaultFileTypes, "Files to update")
40+
cmd.Flags().StringP("directory", "d", ".", "Directory to update files")
4141
}
4242

4343
// bindFileFlags binds the pr flag values to viper

digestabotctl/cmd/update.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ var updateCmd = &cobra.Command{
1313

1414
func init() {
1515
rootCmd.AddCommand(updateCmd)
16-
fileFlags(updateCmd)
1716
prFlags(updateCmd)
1817

1918
}
2019
func bindUpdateCmdFlags(cmd *cobra.Command, args []string) {
21-
bindFileFlags(cmd)
2220
bindPRFlags(cmd)
2321
}

0 commit comments

Comments
 (0)