Skip to content

Commit

Permalink
correção params
Browse files Browse the repository at this point in the history
  • Loading branch information
Lariel committed Aug 16, 2024
1 parent a8c5cf2 commit 49f3581
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
34 changes: 16 additions & 18 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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;
}

Expand Down
9 changes: 3 additions & 6 deletions bin/params.js
Original file line number Diff line number Diff line change
@@ -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};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 49f3581

Please sign in to comment.