Skip to content

Commit

Permalink
Merge pull request #16 from kyoshidajp/year_option
Browse files Browse the repository at this point in the history
Support maximum years of inactivity option
  • Loading branch information
kyoshidajp authored Oct 27, 2023
2 parents ae86bd6 + 961b877 commit 37e98f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/diagnose.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Options struct {
packageManager string
lockFilePath string
ignores string
year int
}

func (o *Options) Ignores() []string {
Expand Down Expand Up @@ -91,7 +92,7 @@ var diagnoseCmd = &cobra.Command{
}

department := NewDepartment(doctor)
diagnoses := department.Diagnose(f, MAX_YEAR_TO_BE_BLANK, o.Ignores())
diagnoses := department.Diagnose(f, o.year, o.Ignores())
if err := Report(diagnoses); err != nil {
os.Exit(1)
}
Expand All @@ -103,6 +104,7 @@ func init() {
diagnoseCmd.Flags().StringVarP(&o.packageManager, "package", "p", "bundler", "package manager")
diagnoseCmd.Flags().StringVarP(&o.lockFilePath, "lock_file", "f", "Gemfile.lock", "lock file path")
diagnoseCmd.Flags().StringVarP(&o.ignores, "ignores", "i", "", "ignore dependencies")
diagnoseCmd.Flags().IntVarP(&o.year, "year", "y", MAX_YEAR_TO_BE_BLANK, "max years of inactivity")
}

func Report(diagnoses map[string]Diagnosis) error {
Expand Down

0 comments on commit 37e98f3

Please sign in to comment.