From 6e5f6d0c1dfd74eca9e12e5d09a7f5d25e6e912e Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 20:57:16 +0100 Subject: [PATCH 1/9] Remove compiled JavaScript files from git repo --- .gitignore | 1 + lib/data-utils.js | 48 --------- lib/jira-cli.js | 240 ------------------------------------------ lib/jira.js | 233 ---------------------------------------- lib/pretty-printer.js | 71 ------------- 5 files changed, 1 insertion(+), 592 deletions(-) delete mode 100644 lib/data-utils.js delete mode 100644 lib/jira-cli.js delete mode 100755 lib/jira.js delete mode 100644 lib/pretty-printer.js diff --git a/.gitignore b/.gitignore index a72b52e..5b06be9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ lib-cov *.gz pids +lib logs results diff --git a/lib/data-utils.js b/lib/data-utils.js deleted file mode 100644 index 827e55a..0000000 --- a/lib/data-utils.js +++ /dev/null @@ -1,48 +0,0 @@ -(function() { - var ask, itemSorter, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - ask = function(question, format, callback, range) { - var stdin, stdout; - stdin = process.stdin; - stdout = process.stdout; - stdin.resume(); - stdout.write(question + ": "); - return stdin.once('data', function(data) { - var _ref; - data = data.toString().trim(); - if (range != null) { - if (_ref = parseInt(data), __indexOf.call(range, _ref) >= 0) { - callback(data); - return; - } - } else if (format.test(data)) { - callback(data); - return; - } - stdout.write("It should match: " + format + "\n"); - return ask(question, format, callback, range); - }); - }; - - itemSorter = function(a, b) { - var first, second; - first = parseInt(a.id); - second = parseInt(b.id); - if (first < second) { - return -1; - } - if (first === second) { - return 0; - } - if (first > second) { - return 1; - } - }; - - module.exports = { - ask: ask, - itemSorter: itemSorter - }; - -}).call(this); diff --git a/lib/jira-cli.js b/lib/jira-cli.js deleted file mode 100644 index 4b3c1e4..0000000 --- a/lib/jira-cli.js +++ /dev/null @@ -1,240 +0,0 @@ -(function() { - var JiraApi, JiraHelper, Logger, PrettyPrinter, color; - - color = require('ansi-color').set; - - PrettyPrinter = require('./pretty-printer').PrettyPrinter; - - JiraApi = require('jira').JiraApi; - - Logger = (function() { - function Logger() {} - - Logger.prototype.error = function(text) { - return this.log(text, "red"); - }; - - Logger.prototype.log = function(text, textColor) { - if (textColor == null) { - textColor = 'white'; - } - return console.log(color(text, textColor)); - }; - - return Logger; - - })(); - - JiraHelper = (function() { - function JiraHelper(config) { - this.config = config; - if (this.config.strictSSL == null) { - this.config.strictSSL = true; - } - if (this.config.protocol == null) { - this.config.protocol = 'http:'; - } - this.jira = new JiraApi(this.config.protocol, this.config.host, this.config.port, this.config.user, this.config.password, '2', false, this.config.strictSSL); - this.response = null; - this.error = null; - this.pp = new PrettyPrinter; - this.log = new Logger; - } - - JiraHelper.prototype.dieWithFire = function() { - return process.exit(); - }; - - JiraHelper.prototype.getIssue = function(issueNum, details) { - var _this = this; - return this.jira.findIssue(issueNum, function(error, response) { - if (response != null) { - _this.response = response; - return _this.pp.prettyPrintIssue(response, details); - } else { - if (error != null) { - _this.error = error; - } - return _this.log.error("Error finding issue: " + error); - } - }); - }; - - JiraHelper.prototype.getIssueTypes = function(callback) { - var _this = this; - return this.jira.listIssueTypes(function(error, response) { - if (response != null) { - return callback(response); - } else { - _this.log.error("Error listing issueTypes: " + error); - return _this.dieWithFire(); - } - }); - }; - - JiraHelper.prototype.createIssueObject = function(project, summary, issueType, description) { - return { - fields: { - project: { - id: project - }, - summary: summary, - issuetype: { - id: issueType - }, - assignee: { - name: this.config.user - }, - description: description - } - }; - }; - - JiraHelper.prototype.addIssue = function(summary, description, issueType, project) { - var newIssue, - _this = this; - newIssue = this.createIssueObject(project, summary, issueType, description); - return this.jira.addNewIssue(newIssue, function(error, response) { - if (response != null) { - if (response != null) { - _this.response = response; - } - _this.log.log(("Issue " + response.key + " has ") + ("been " + (color("created", "green")))); - } else { - if (error != null) { - _this.error = error; - } - _this.log.error("Error creating issue: " + (JSON.stringify(error))); - } - return _this.dieWithFire(); - }); - }; - - JiraHelper.prototype.deleteIssue = function(issueNum) { - var _this = this; - return this.jira.deleteIssue(issueNum, function(error, response) { - if (response != null) { - _this.response = response; - return _this.log.log("Issue " + issueNum + " was " + (color("deleted", "green"))); - } else { - if (error != null) { - _this.error = error; - } - return _this.log.error("Error deleting issue: " + error); - } - }); - }; - - JiraHelper.prototype.addWorklog = function(issueId, comment, timeSpent, exit) { - var worklog, - _this = this; - worklog = { - comment: comment, - timeSpent: timeSpent - }; - return this.jira.addWorklog(issueId, worklog, function(error, response) { - if (response != null) { - _this.log.log("Worklog was " + (color("added", "green"))); - } else { - if (error != null) { - _this.error = error; - } - _this.log.error("Error adding worklog: " + error); - } - if (exit) { - return _this.dieWithFire(); - } - }); - }; - - JiraHelper.prototype.listTransitions = function(issueNum, callback) { - var _this = this; - return this.jira.listTransitions(issueNum, function(error, transitions) { - if (transitions != null) { - return callback(transitions); - } else { - _this.log.error("Error getting transitions: " + error); - return _this.dieWithFire(); - } - }); - }; - - JiraHelper.prototype.transitionIssue = function(issueNum, transitionNum) { - var issueUpdate, - _this = this; - issueUpdate = { - transition: { - id: transitionNum - } - }; - return this.jira.transitionIssue(issueNum, issueUpdate, function(error, response) { - if (response != null) { - _this.response = response; - _this.log.log(("Issue " + issueNum + " ") + ("was " + (color("transitioned", "green")))); - } else { - if (error != null) { - _this.error = error; - } - _this.log.error("Error transitioning issue: " + error); - } - return _this.dieWithFire(); - }); - }; - - JiraHelper.prototype.searchJira = function(searchQuery, details) { - var fields, - _this = this; - fields = ["summary", "status", "assignee"]; - return this.jira.searchJira(searchQuery, fields, function(error, issueList) { - var issue, _i, _len, _ref, _results; - if (issueList != null) { - _this.myIssues = issueList; - _ref = issueList.issues; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - issue = _ref[_i]; - _results.push(_this.pp.prettyPrintIssue(issue, details)); - } - return _results; - } else { - if (error != null) { - _this.error = error; - } - return _this.log.error("Error retreiving issues list: " + error); - } - }); - }; - - JiraHelper.prototype.getMyIssues = function(open, details, projects) { - var jql; - jql = "assignee = \"" + this.config.user + "\""; - if (open) { - jql += ' AND resolution = unresolved'; - } - if (projects != null) { - jql += projects; - } - this.searchJira(jql, details); - }; - - JiraHelper.prototype.getMyProjects = function(callback) { - var _this = this; - return this.jira.listProjects(function(error, projectList) { - if (projectList != null) { - return callback(projectList); - } else { - _this.log.error("Error listing projects: " + error); - return _this.dieWithFire(); - } - }); - }; - - return JiraHelper; - - })(); - - module.exports = { - JiraHelper: JiraHelper - }; - -}).call(this); diff --git a/lib/jira.js b/lib/jira.js deleted file mode 100755 index e4d56b7..0000000 --- a/lib/jira.js +++ /dev/null @@ -1,233 +0,0 @@ -#!/usr/bin/env node -(function() { - var JiraHelper, addItem, addWorklog, args, argv, configFile, configFilePath, createConfigFile, dutils, fs, getProject, jiraCli, listProjects, loadConfigFile, paramIsText, path, transitionItem; - - fs = require('fs'); - - path = require('path'); - - JiraHelper = require('./jira-cli').JiraHelper; - - dutils = require('./data-utils'); - - createConfigFile = function(aConfigFile) { - console.log("No config file found, answer these questions to create one!"); - return dutils.ask("Username", /.+/, function(username) { - return dutils.ask("Password", /.+/, function(password) { - return dutils.ask("Jira Host", /.+/, function(host) { - return dutils.ask("Jira Port", /.+/, function(port) { - return dutils.ask("Default Project", /.*/, function(project) { - var config; - config = { - user: username, - password: password, - host: host, - port: port, - project: project - }; - fs.writeFileSync(aConfigFile, JSON.stringify(config), 'utf8'); - console.log("File created and saved as " + aConfigFile); - return process.exit(); - }); - }); - }); - }); - }); - }; - - paramIsText = function(param) { - if (typeof param === "boolean") { - argv.showHelp(); - return false; - } - return true; - }; - - loadConfigFile = function(configFilePath) { - var configFile; - configFile = fs.readFileSync(configFilePath); - return JSON.parse(configFile); - }; - - transitionItem = function(issueId) { - return jiraCli.listTransitions(issueId, function(transitions) { - var allowedTypes, index, transition, _i, _j, _len, _ref, _results; - transitions.sort(dutils.itemSorter); - for (index = _i = 0, _len = transitions.length; _i < _len; index = ++_i) { - transition = transitions[index]; - jiraCli.pp.prettyPrintTransition(transition, index + 1); - } - allowedTypes = (function() { - _results = []; - for (var _j = 1, _ref = transitions.length; 1 <= _ref ? _j <= _ref : _j >= _ref; 1 <= _ref ? _j++ : _j--){ _results.push(_j); } - return _results; - }).apply(this); - return dutils.ask("Transtion Type ", allowedTypes, function(type) { - return dutils.ask("Comment for worklog (blank to skip)", /.*/, function(comment) { - if (comment.length === 0) { - jiraCli.transitionIssue(issueId, transitions[type - 1].id); - return; - } - return dutils.ask("Time Spent (for worklog)", /.+/, function(timeSpent) { - jiraCli.addWorklog(issueId, comment, timeSpent, false); - return jiraCli.transitionIssue(issueId, transitions[type - 1].id); - }); - }); - }, allowedTypes); - }); - }; - - addWorklog = function(issueId) { - return dutils.ask("Comment for worklog", /.+/, function(comment) { - return dutils.ask("Time Spent (for worklog)", /.+/, function(timeSpent) { - return jiraCli.addWorklog(issueId, comment, timeSpent, true); - }); - }); - }; - - listProjects = function() { - var projects, - _this = this; - return projects = jiraCli.getMyProjects(function(projects) { - var project, _i, _len, _results; - _results = []; - for (_i = 0, _len = projects.length; _i < _len; _i++) { - project = projects[_i]; - _results.push(jiraCli.pp.prettyPrintProject(project)); - } - return _results; - }); - }; - - getProject = function(callback, defaultProj) { - return dutils.ask("Project (Enter for Default/? for list) [" + defaultProj + "] ", /.*/, function(project) { - var projects, - _this = this; - if (project !== '?') { - callback(configFile.project); - return; - } - return projects = jiraCli.getMyProjects(function(projects) { - var _i, _len; - for (_i = 0, _len = projects.length; _i < _len; _i++) { - project = projects[_i]; - jiraCli.pp.prettyPrintProject(project); - } - return getProject(callback, defaultProj); - }); - }); - }; - - addItem = function(project) { - return dutils.ask("Summary", /.+/, function(summary) { - return dutils.ask("Description", /.+/, function(description) { - return jiraCli.getIssueTypes(function(issueTypes) { - var addIssueCallback, allowedTypes, index, type, _i, _j, _len, _ref, _results; - issueTypes.sort(dutils.itemSorter); - for (index = _i = 0, _len = issueTypes.length; _i < _len; index = ++_i) { - type = issueTypes[index]; - jiraCli.pp.prettyPrintIssueTypes(type, index + 1); - } - allowedTypes = (function() { - _results = []; - for (var _j = 1, _ref = issueTypes.length; 1 <= _ref ? _j <= _ref : _j >= _ref; 1 <= _ref ? _j++ : _j--){ _results.push(_j); } - return _results; - }).apply(this); - addIssueCallback = function(type) { - return jiraCli.addIssue(summary, description, issueTypes[type - 1].id, project); - }; - return dutils.ask("Type ", allowedTypes, addIssueCallback, allowedTypes); - }); - }); - }); - }; - - if (require.main === module) { - argv = (require('optimist')).options('f', { - alias: 'find', - describe: 'Finds the specified Jira ID' - }).options('a', { - alias: 'add', - describe: 'Allows you to add a new Jira Task' - }).options('t', { - alias: 'transition', - describe: 'Allows you to resolve a specific Jira ID' - }).options('l', { - alias: 'list', - describe: 'Lists all your open issues' - }).options('c', { - alias: 'list-all', - describe: 'Lists all your issues' - }).options('d', { - alias: 'details', - describe: 'Shows extra details (currently only for list)' - }).options('p', { - alias: 'projects', - describe: 'Lists all your viewable projects' - }).options('o', { - describe: 'Limits list to only this project' - }).options('w', { - alias: 'worklog', - describe: 'Adds work to your task' - }).options('s', { - alias: 'search', - describe: 'Pass a jql string to jira' - }).options('h', { - alias: 'help', - describe: 'Shows this help message' - }).usage('Usage:\n\tjira -f EG-143\n\tjira -r EG-143').boolean('d').string('s').string('f').string('t').string('w'); - if (argv.argv.help) { - argv.showHelp(); - return; - } - args = argv.argv; - configFilePath = path.join(process.env.HOME, '.jiraclirc.json'); - if (!fs.existsSync(configFilePath)) { - createConfigFile(configFilePath); - return; - } - configFile = loadConfigFile(configFilePath); - jiraCli = new JiraHelper(configFile); - if (args.o != null) { - if (args.o instanceof Array) { - args.o = args.o.join(','); - } - args.o = " AND project in (" + args.o + ")"; - } - if (args.l) { - jiraCli.getMyIssues(true, args.d, args.o); - } else if (args.c) { - jiraCli.getMyIssues(false, args.d, args.o); - } else if (args.s) { - if (!paramIsText(args.s)) { - return; - } - if (args.o != null) { - args.s += args.o; - } - jiraCli.searchJira(args.s, args.d); - } else if (args.p) { - listProjects(); - } else if (args.a) { - getProject(addItem, configFile.project); - } else if (args.f != null) { - if (!paramIsText(args.f)) { - return; - } - jiraCli.getIssue(args.f, args.d); - } else if (args.w != null) { - if (!paramIsText(args.w)) { - return; - } - addWorklog(args.w); - } else if (args.t != null) { - if (!paramIsText(args.t)) { - return; - } - transitionItem(args.t); - } else { - argv.showHelp(); - } - } - -}).call(this); diff --git a/lib/pretty-printer.js b/lib/pretty-printer.js deleted file mode 100644 index ca08b28..0000000 --- a/lib/pretty-printer.js +++ /dev/null @@ -1,71 +0,0 @@ -(function() { - var PrettyPrinter, color, wrap; - - color = require('ansi-color').set; - - wrap = require('wordwrap')(5, 65); - - PrettyPrinter = (function() { - function PrettyPrinter() {} - - PrettyPrinter.prototype.prettyPrintIssue = function(issue, detail) { - var sumColor, _ref; - sumColor = "green"; - if ((_ref = +issue.fields.status.id) === 5 || _ref === 6) { - sumColor = "red"; - } - process.stdout.write(color(issue.key, sumColor + "+bold")); - if (issue.fields.summary == null) { - issue.fields.summary = "None"; - } - process.stdout.write(" - "); - process.stdout.write(issue.fields.summary); - process.stdout.write("\n"); - if (detail && (issue.fields.description != null)) { - process.stdout.write(color("Description:\n", "white+bold")); - process.stdout.write(wrap(issue.fields.description)); - return process.stdout.write("\n\n"); - } - }; - - PrettyPrinter.prototype.prettyPrintIssueTypes = function(issueType, index) { - process.stdout.write(color(index, "white+bold")); - process.stdout.write(" - "); - process.stdout.write(issueType.name); - if (issueType.description.length > 0) { - process.stdout.write(" - "); - process.stdout.write(issueType.description); - } - return process.stdout.write("\n"); - }; - - PrettyPrinter.prototype.prettyPrintTransition = function(transition, index) { - process.stdout.write(color(index, "white+bold")); - process.stdout.write(" - "); - process.stdout.write(transition.name); - return process.stdout.write("\n"); - }; - - PrettyPrinter.prototype.prettyPrintProject = function(project) { - var key; - key = project.key; - while (key.length < 12) { - key = ' ' + key; - } - process.stdout.write(color(key, "white+bold")); - process.stdout.write(" - "); - process.stdout.write(project.id); - process.stdout.write(" - "); - process.stdout.write(project.name); - return process.stdout.write("\n"); - }; - - return PrettyPrinter; - - })(); - - module.exports = { - PrettyPrinter: PrettyPrinter - }; - -}).call(this); From 56e34084461d8e2e4cef26625747f0f888e220f1 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 21:05:13 +0100 Subject: [PATCH 2/9] Explicitly set dependency versions --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 94ae8fc..777bf8e 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,9 @@ "test": "node -e 'require(\"grunt\").cli()'" }, "dependencies": { - "jira": ">= 0.0.5", - "optimist": "~0.3.5", - "ansi-color": "~0.2.1", + "jira": "0.9.2", + "optimist": "0.6.1", + "ansi-color": "0.2.1", "wordwrap": "0.0.2" }, "keywords": [ From 5bdb02a0177ff249cd72223cfb7348c1db11cd47 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 21:36:14 +0100 Subject: [PATCH 3/9] Add grunt-cli and coffee-script as dev dep --- package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 777bf8e..db6172e 100644 --- a/package.json +++ b/package.json @@ -43,12 +43,14 @@ "whisky" ], "devDependencies": { + "coffee-script": "^1.8.0", "grunt": "~0.4.1", "grunt-bump": "0.0.2", - "grunt-contrib-coffee": "~0.7.0", + "grunt-cli": "^0.1.13", "grunt-coffeelint": "0.0.6", - "grunt-jasmine-node": "~0.1.0", + "grunt-contrib-coffee": "~0.7.0", + "grunt-contrib-concat": "~0.3.0", "grunt-docco": "~0.2.0", - "grunt-contrib-concat": "~0.3.0" + "grunt-jasmine-node": "~0.1.0" } } From be748912f3b05fbdd43e3605b714855073613b4c Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 21:37:56 +0100 Subject: [PATCH 4/9] Add some process exit codes Relates to tebriel/jira-cli#18 --- src/jira.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jira.coffee b/src/jira.coffee index b54fd72..bfe3b8b 100644 --- a/src/jira.coffee +++ b/src/jira.coffee @@ -50,7 +50,7 @@ createConfigFile = (aConfigFile) -> paramIsText = (param)-> if typeof(param) is "boolean" argv.showHelp() - return false + process.exit 1 true # ## Load the Config File ## @@ -184,13 +184,13 @@ if require.main is module if argv.argv.help argv.showHelp() - return + process.exit 0 args = argv.argv configFilePath = path.join process.env.HOME, '.jiraclirc.json' unless fs.existsSync configFilePath createConfigFile configFilePath - return + process.exit 0 configFile = loadConfigFile(configFilePath) jiraCli = new JiraHelper configFile @@ -224,3 +224,5 @@ if require.main is module transitionItem args.t else argv.showHelp() + process.exit 1 + From 0ce6a1b113a57d1dc5b6bf50cd31e86bb42ff215 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 21:39:28 +0100 Subject: [PATCH 5/9] Close tebriel/jira-cli#19 Implement -v (--version) --- src/jira.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/jira.coffee b/src/jira.coffee index bfe3b8b..1745eaf 100644 --- a/src/jira.coffee +++ b/src/jira.coffee @@ -175,6 +175,9 @@ if require.main is module ).options('h', alias:'help' describe:'Shows this help message' + ).options('v', + alias:'version' + describe:'Shows jira-cli version' ).usage('Usage:\n\tjira -f EG-143\n\tjira -r EG-143') .boolean('d') .string('s') @@ -185,6 +188,11 @@ if require.main is module if argv.argv.help argv.showHelp() process.exit 0 + + if argv.argv.version + console.log 'v1.0.0' + process.exit 0 + args = argv.argv configFilePath = path.join process.env.HOME, '.jiraclirc.json' From 797e532dcd5dd074d61ac79c87c4f34ff3c9af5a Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 21:40:35 +0100 Subject: [PATCH 6/9] Fix white space line --- src/jira.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jira.coffee b/src/jira.coffee index 1745eaf..95bb2bb 100644 --- a/src/jira.coffee +++ b/src/jira.coffee @@ -131,7 +131,7 @@ addItem = (project)-> issueTypes.sort dutils.itemSorter for type, index in issueTypes jiraCli.pp.prettyPrintIssueTypes type, index + 1 - + allowedTypes = [1..issueTypes.length] addIssueCallback = (type)-> jiraCli.addIssue summary, description, From bc900242b049a761fc2f85ea4900106c888c12e2 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 21:41:04 +0100 Subject: [PATCH 7/9] Bump version to v1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db6172e..47c71bb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jira-cli", "description": "Command line interface for Jira", - "version": "0.5.0", + "version": "1.0.0", "homepage": "https://tebriel.github.com/jira-cli", "author": { "name": "Chris Moultrie", From f165af9a323bd34542b15d5d3310c33a9dc786c7 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 21:53:21 +0100 Subject: [PATCH 8/9] Close tebriel/jira-cli#20 Fix broken transitions --- src/jira.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jira.coffee b/src/jira.coffee index 95bb2bb..994c8a6 100644 --- a/src/jira.coffee +++ b/src/jira.coffee @@ -66,8 +66,10 @@ loadConfigFile = (configFilePath) -> # lets the user apply that transition to the item. Optionally the user can # specify a comment which will then prompt for time spent. This adds a work log # item to the item before the transition. + transitionItem = (issueId) -> jiraCli.listTransitions issueId, (transitions) -> + transitions = transitions.transitions transitions.sort dutils.itemSorter for transition, index in transitions jiraCli.pp.prettyPrintTransition transition, index + 1 From 89a781cae6ff74dbba760b62134f9cad64cec785 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Wed, 28 Jan 2015 22:03:27 +0100 Subject: [PATCH 9/9] Document .jiraclirc.json config options Relates to tebriel/jira-cli#14 --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ed980d4..378751c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ interface. * Lists all a user's issues * List all a user's projects * Finds an issue by Key (AB-123) or Id (123456) -* Opens an issue +* Opens an issue * Allows user to add a new ticket to different projects * Transitions an issue (shows all available transition states) * Adds a worklog to an issue @@ -36,10 +36,19 @@ interface. `jira -f AB-123` -## Notes ## +## Config file ## -If you use `https:` for jira, add `"protocol": "https:"` to your .jiraclirc.json -If your ssl certs are also self-signed add: `"strictSSL": false` to your .jiraclirc.json +The first time you run `jira` the program will help you set up your +`.jiraclirc.json` configuration file. The configuration file is a basic JSON +file accpets the following properties: + +* `user` - your username +* `password` - your password +* `host` - host name to the JIRA installation (eg. `jira.example.com`) +* `port` - port for the JIRA installation (eg. `80` or `443`) +* `protocol` - http protocol for API communication (`http:` or `https:`) +* `strictSSL` - set this to `false` if you are using a self signed SSL certificat +* `project` - default project ID (eg. `10013`) ## Testing ## @@ -82,5 +91,5 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. ## License -Copyright (c) 2012 Chris Moultrie +Copyright (c) 2012 Chris Moultrie Licensed under the MIT license.