@@ -7,6 +7,11 @@ export function getOptionsFromCliArgs(
7
7
argv : string [ ]
8
8
) {
9
9
const cliArgs = yargs ( argv )
10
+ // TODO: remove `any` downcast as soon as this PR is merged: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/38108
11
+ . parserConfiguration ( {
12
+ 'strip-dashed' : true ,
13
+ 'strip-aliased' : true
14
+ } as any )
10
15
. usage ( '$0 [args]' )
11
16
. wrap ( Math . max ( 100 , Math . min ( 120 , yargs . terminalWidth ( ) ) ) )
12
17
. option ( 'accessToken' , {
@@ -97,6 +102,11 @@ export function getOptionsFromCliArgs(
97
102
type : 'number' ,
98
103
alias : 'pr'
99
104
} )
105
+ . option ( 'resetAuthor' , {
106
+ default : false ,
107
+ description : 'Set yourself as commit author' ,
108
+ type : 'boolean'
109
+ } )
100
110
. option ( 'sha' , {
101
111
description : 'Commit sha to backport' ,
102
112
type : 'string' ,
@@ -116,27 +126,13 @@ export function getOptionsFromCliArgs(
116
126
. version ( )
117
127
. help ( ) . argv ;
118
128
129
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
130
+ const { $0, _, ...rest } = cliArgs ;
131
+
119
132
return {
120
- accessToken : cliArgs . accessToken ,
121
- all : cliArgs . all ,
122
- apiHostname : cliArgs . apiHostname ,
123
- author : cliArgs . author ,
124
- commitsCount : cliArgs . commitsCount ,
133
+ ...rest ,
125
134
branchChoices : configOptions . branchChoices ,
126
- branches : cliArgs . branches ,
127
- editor : cliArgs . editor ,
128
- fork : cliArgs . fork ,
129
- gitHostname : cliArgs . gitHostname ,
130
- labels : cliArgs . labels ,
131
- multiple : cliArgs . multiple ,
132
135
multipleBranches : cliArgs . multipleBranches || cliArgs . multiple ,
133
- multipleCommits : cliArgs . multipleCommits || cliArgs . multiple ,
134
- path : cliArgs . path ,
135
- prTitle : cliArgs . prTitle ,
136
- prDescription : cliArgs . prDescription ,
137
- pullNumber : cliArgs . pullNumber ,
138
- sha : cliArgs . sha ,
139
- upstream : cliArgs . upstream ,
140
- username : cliArgs . username
136
+ multipleCommits : cliArgs . multipleCommits || cliArgs . multiple
141
137
} ;
142
138
}
0 commit comments