code-story
Version:
Get your code activity log for standup from git
86 lines (85 loc) • 3.11 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var yargs_1 = __importDefault(require("yargs"));
var headerTypes = ['full', 'minimal', 'off'];
var getOptionsFromArguments = function () {
return yargs_1.default
.scriptName('codestory')
.usage('Syntax: $0 [options]')
.example('$0 --since 3.day.ago', 'Get commit story by 3 last day')
.options({
since: {
type: 'string',
alias: 's',
describe: 'Show commits more recent than a specific date.',
},
after: {
type: 'string',
alias: 'a',
describe: 'Show commits more recent than a specific date.',
},
until: {
type: 'string',
alias: 'u',
describe: 'Show commits older than a specific date.',
},
before: {
type: 'string',
alias: 'b',
describe: 'Show commits older than a specific date.',
},
trackerUrl: {
type: 'string',
alias: 't',
describe: 'Base url in task tracker system.',
},
author: {
type: 'string',
describe: 'Limit the commits output to ones with author header lines that match the specified pattern.',
},
branch: {
type: 'string',
alias: 'b',
describe: 'Show only commits in the specified branch or revision range.',
},
number: {
type: 'number',
alias: 'n',
describe: 'The number of commits to return',
default: 999,
},
file: {
type: 'string',
alias: 'f',
describe: 'File filter for the git log command',
},
committer: {
type: 'string',
describe: 'Limit the commits output to ones with author header lines that match the specified pattern.',
},
showCommitFiles: {
type: 'boolean',
describe: 'Show files changed in commits.',
},
clearConsole: {
type: 'boolean',
describe: 'Clear console before out info',
},
workingDaysOfWeek: {
type: 'string',
describe: "Set working days of the week, use 2 first letter of day in the list and separated a comma.\n Use ! symbol for exclude day. Example: --workingDaysOfWeek=\"!Su,!Sa\"",
},
startDayTime: {
type: 'string',
describe: "Sets the start time of the day. The commit history will start and end from this time.\n Format: hours:minutes. Example: --startDayTime=\"09:00\"",
},
})
.option('header', { choices: headerTypes, describe: 'Cli header type' })
.help('h')
.alias('h', 'help')
.wrap(yargs_1.default.terminalWidth()).argv;
};
exports.default = getOptionsFromArguments;