Skip to content

Commit 961b877

Browse files
committed
Support maximum years of inactivity option
1 parent ae86bd6 commit 961b877

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/diagnose.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type Options struct {
4949
packageManager string
5050
lockFilePath string
5151
ignores string
52+
year int
5253
}
5354

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

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

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

0 commit comments

Comments
 (0)