From 49f3581097520ff554e6b1f9278d85850cbacff2 Mon Sep 17 00:00:00 2001 From: Lariel Date: Fri, 16 Aug 2024 17:48:36 -0300 Subject: [PATCH] =?UTF-8?q?corre=C3=A7=C3=A3o=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/index.js | 34 ++++++++++++++++------------------ bin/params.js | 9 +++------ package.json | 2 +- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/bin/index.js b/bin/index.js index 7749bd5..376bc92 100755 --- a/bin/index.js +++ b/bin/index.js @@ -103,22 +103,22 @@ function getPullRequests() { function handleHelpParam(param) { const HELP_TEXT = ` - ------------------------------------------------------------------------------------------------------------------ - | Help: | - | Usage: | + ---------------------------------------------------------------------------------------- + | Help: + | Usage: | $ fetch-pullrequests - | | - | Options: | - | ${P_HELP.value} ${P_HELP.helpText} [${P_HELP.type}] | - | ${P_VERSION.value} ${P_VERSION.helpText} [${P_VERSION.type}] | - | ${P_DEBUG.value} ${P_DEBUG.helpText} [${P_DEBUG.type}] | - | | - | Configs found: | - | Repos: ${reposFilter.length} | - | Revisor: ${REVIEWER} | - | | - | | - ------------------------------------------------------------------------------------------------------------------ + | + | Options: + | ${P_HELP.values} ${P_HELP.helpText} + | ${P_VERSION.values} ${P_VERSION.helpText} + | ${P_DEBUG.values} ${P_DEBUG.helpText} + | + | Configs found: + | Repos: ${reposFilter.length} + | Revisor: ${REVIEWER ? REVIEWER : 'Não configurado no arquivo'} ${process.env.FETCH_PR}/configs.js + | + | + ---------------------------------------------------------------------------------------- ` const doHelp = () => { @@ -159,9 +159,7 @@ function handleParams(paramsList) { handleDebugParam(param); }); - if (((!envParam && !serviceParam) || (tagParam && serviceParam)) - && !helpParam && !versionParam) { - console.error(INVALID_PARAMS +GREETINGS); + if (helpParam || versionParam) { return; } diff --git a/bin/params.js b/bin/params.js index 32af6e5..1e85deb 100644 --- a/bin/params.js +++ b/bin/params.js @@ -1,17 +1,14 @@ const P_HELP = { values: ['-h','-help'], - helpText: 'Show this help', - type: 'boolean' + helpText: 'Shows this help' }; const P_VERSION = { values: ['-v','-version'], - helpText: 'Show version information', - type: 'boolean' + helpText: 'Shows version information' }; const P_DEBUG = { values: ['-debug'], - helpText: 'Shows more information while running', - type: 'boolean' + helpText: 'Shows more information while running' }; module.exports = {P_HELP, P_VERSION, P_DEBUG}; \ No newline at end of file diff --git a/package.json b/package.json index 22444ec..2abd4bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fetch-pullrequests", - "version": "0.2.0", + "version": "0.2.1", "description": "CLI para buscar pull requests no Azure DevOps", "main": "bin/index.js", "repository": {