@@ -14,6 +14,8 @@ class Options
1414 LOCAL = 'local'
1515 ONLINE = 'online'
1616 SINGLE = 'single'
17+ DEFAULT_CONFIG_PATH = ResourceLocator . locate ( 'config/all-java.xml' )
18+ DEFAULT_LIST_PATH = ResourceLocator . locate ( 'config/project-list.xml' )
1719
1820 attr_reader :local_git_repo
1921 attr_reader :base_branch
@@ -68,11 +70,14 @@ def parse(argv)
6870 o . string '-b' , '--base-branch' , 'name of the base branch in local PMD repository'
6971 o . string '-p' , '--patch-branch' ,
7072 'name of the patch branch in local PMD repository'
71- o . string '-bc' , '--base-config' , 'path to the base PMD configuration file'
72- o . string '-pc' , '--patch-config' , 'path to the patch PMD configuration file'
73+ o . string '-bc' , '--base-config' , 'path to the base PMD configuration file' ,
74+ default : DEFAULT_CONFIG_PATH
75+ o . string '-pc' , '--patch-config' , 'path to the patch PMD configuration file' ,
76+ default : DEFAULT_CONFIG_PATH
7377 o . string '-c' , '--config' , 'path to the base and patch PMD configuration file'
7478 o . string '-l' , '--list-of-project' ,
75- 'path to the file which contains the list of standard projects'
79+ 'path to the file which contains the list of standard projects' ,
80+ default : DEFAULT_LIST_PATH
7681 o . string '-m' , '--mode' , mode_message , default : 'local'
7782 o . bool '-f' , '--html-flag' ,
7883 'whether to not generate the html diff report in single mode'
@@ -111,20 +116,17 @@ def check_options
111116 def check_local_options
112117 check_option ( LOCAL , 'base branch name' , @base_branch )
113118 check_option ( LOCAL , 'base branch config path' , @base_config ) unless @auto_config_flag
114- check_option ( LOCAL , 'patch branch name' , @patch_branch )
115119 check_option ( LOCAL , 'patch branch config path' , @patch_config ) unless @auto_config_flag
116120 check_option ( LOCAL , 'list of projects file path' , @project_list )
117121 end
118122
119123 def check_single_options
120- check_option ( SINGLE , 'patch branch name' , @patch_branch )
121124 check_option ( SINGLE , 'patch branch config path' , @patch_config )
122125 check_option ( SINGLE , 'list of projects file path' , @project_list )
123126 end
124127
125128 def check_online_options
126129 check_option ( ONLINE , 'base branch name' , @base_branch )
127- check_option ( ONLINE , 'patch branch name' , @patch_branch )
128130 end
129131
130132 def check_common_options
0 commit comments