Added patch from 2.1.x, dir option to pit-cli. Added .gitignore
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					*.sw*
 | 
				
			||||||
 | 
					*/build/
 | 
				
			||||||
							
								
								
									
										11
									
								
								pit-cli/src/com/jdbernard/pit/PersonalIssueTrackerCLI.groovy
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										11
									
								
								pit-cli/src/com/jdbernard/pit/PersonalIssueTrackerCLI.groovy
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -1,9 +1,11 @@
 | 
				
			|||||||
package com.jdbernard.pit
 | 
					package com.jdbernard.pit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.jdbernard.pit.file.*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import static java.lang.Math.max
 | 
					import static java.lang.Math.max
 | 
				
			||||||
import static java.lang.Math.min
 | 
					import static java.lang.Math.min
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def cli = new CliBuilder(usage: '')
 | 
					def cli = new CliBuilder(usage: 'pit-cli [options]')
 | 
				
			||||||
cli.h(longOpt: 'help', 'Show help information.')
 | 
					cli.h(longOpt: 'help', 'Show help information.')
 | 
				
			||||||
cli.v(longOpt: 'verbose', 'Show verbose task information')
 | 
					cli.v(longOpt: 'verbose', 'Show verbose task information')
 | 
				
			||||||
cli.l(longOpt: 'list', 'List issues. Unless otherwise specified it lists all '
 | 
					cli.l(longOpt: 'list', 'List issues. Unless otherwise specified it lists all '
 | 
				
			||||||
@@ -32,9 +34,12 @@ cli.C(argName: 'new-category', longOpt: 'set-category', args: 1,
 | 
				
			|||||||
cli.T(argName: 'new-status', longOpt: 'set-status', args: 1,
 | 
					cli.T(argName: 'new-status', longOpt: 'set-status', args: 1,
 | 
				
			||||||
    required: false, 'Modify the status of the selected issues.')
 | 
					    required: false, 'Modify the status of the selected issues.')
 | 
				
			||||||
cli.n(longOpt: 'new-issue', 'Create a new issue.')
 | 
					cli.n(longOpt: 'new-issue', 'Create a new issue.')
 | 
				
			||||||
 | 
					cli.d(longOpt: 'dir', argName: 'dir', args: 1, required: false,
 | 
				
			||||||
 | 
					    'Use <dir> as the base directory (defaults to current directory).')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def opts = cli.parse(args)
 | 
					def opts = cli.parse(args)
 | 
				
			||||||
def issuedb = [:]
 | 
					def issuedb = [:]
 | 
				
			||||||
 | 
					def workingDir = new File('.')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (!opts) System.exit(1) // better solution?
 | 
					if (!opts) System.exit(1) // better solution?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -48,10 +53,12 @@ def statusList = ['new', 'validation_required']
 | 
				
			|||||||
if (opts.t) statusList = opts.t.split(/[,\s]/)
 | 
					if (opts.t) statusList = opts.t.split(/[,\s]/)
 | 
				
			||||||
statusList = statusList.collect { Status.toStatus(it) }
 | 
					statusList = statusList.collect { Status.toStatus(it) }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (opts.d) workingDir = new File(opts.d)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def EOL = System.getProperty('line.separator')
 | 
					def EOL = System.getProperty('line.separator')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// build issue list
 | 
					// build issue list
 | 
				
			||||||
issuedb = new FileProject(new File('.'))
 | 
					issuedb = new FileProject(workingDir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// build filter from options
 | 
					// build filter from options
 | 
				
			||||||
def filter = new Filter('categories': categories,
 | 
					def filter = new Filter('categories': categories,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user