Skip to content

Commit

Permalink
fix(yargs): specify types for every CLI option (#878)
Browse files Browse the repository at this point in the history
Fixes #876
  • Loading branch information
webknjaz authored Sep 13, 2022
1 parent dae22df commit 74b1e86
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/helpers/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ const args: ICLIArgument[] = [
{
alias: 'B',
name: 'branch',
type: 'string',
description: 'Specify the branch manually',
},
{
alias: 'b',
name: 'build',
type: 'number',
description: 'Specify the build number manually',
},
{
Expand All @@ -27,11 +29,14 @@ const args: ICLIArgument[] = [
{
alias: 'C',
name: 'sha',
type: 'string',
description: 'Specify the commit SHA manually',
},
{
alias: 'CL',
name: 'changelog',
type: 'boolean',
default: false,
description: 'Display a link for the current changelog'
},
{
Expand All @@ -49,11 +54,13 @@ const args: ICLIArgument[] = [
{
alias: 'f',
name: 'file',
type: 'string',
description: 'Target file(s) to upload',
},
{
alias: 'F',
name: 'flags',
type: 'string',
default: '',
description: 'Flag the upload to group coverage metrics',
},
Expand Down Expand Up @@ -103,17 +110,20 @@ const args: ICLIArgument[] = [
{
alias: 'n',
name: 'name',
type: 'string',
default: '',
description: 'Custom defined name of the upload. Visible in Codecov UI',
},
{
alias: 'N',
name: 'parent',
type: 'string',
description: "The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository provider's API, the parent is determined via finding the closest ancestor to the commit.",
},
{
alias: 'P',
name: 'pr',
type: 'number',
description: 'Specify the pull request number manually',
},
{
Expand All @@ -139,17 +149,20 @@ const args: ICLIArgument[] = [
{
alias: 's',
name: 'dir',
type: 'string',
description: 'Directory to search for coverage reports.\nAlready searches project root and current working directory',
},
{
alias: 'T',
name: 'tag',
type: 'string',
default: '',
description: 'Specify the git tag',
},
{
alias: 't',
name: 'token',
type: 'string',
default: '',
description: 'Codecov upload token',
},
Expand Down
1 change: 1 addition & 0 deletions test/helpers/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('CLI Helper', () => {
alias: 'b',
description: 'Specify the build number manually',
name: 'build',
type: 'number',
})
})
})

0 comments on commit 74b1e86

Please sign in to comment.