8000 Minor cleanup unused parameter · jessevdk/go-flags@4eda719 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 4eda719

Browse files
committed
Minor cleanup unused parameter
1 parent 30073cd commit 4eda719

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

completion.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ func (c *completion) complete(args []string) []Completion {
188188
}
189189

190190
if argumentIsOption(arg) {
191-
prefix, optname, islong := stripOptionPrefix(arg)
192-
optname, _, argument := splitOption(prefix, optname, islong)
191+
_, optname, islong := stripOptionPrefix(arg)
192+
optname, _, argument := splitOption(optname, islong)
193193

194194
if argument == nil {
195195
var o *Option
@@ -250,7 +250,7 @@ func (c *completion) complete(args []string) []Completion {
250250
} else if argumentStartsOption(lastarg) {
251251
// Complete the option
252252
prefix, optname, islong := stripOptionPrefix(lastarg)
253-
optname, split, argument := splitOption(prefix, optname, islong)
253+
optname, split, argument := splitOption(optname, islong)
254254

255255
if argument == nil && !islong {
256256
rname, n := utf8.DecodeRuneInString(optname)

optstyle_other.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func stripOptionPrefix(optname string) (prefix string, name string, islong bool)
4343

4444
// splitOption attempts to split the passed option into a name and an argument.
4545
// When there is no argument specified, nil will be returned for it.
46-
func splitOption(prefix string, option string, islong bool) (string, string, *string) {
46+
func splitOption(option string, islong bool) (string, string, *string) {
4747
pos := strings.Index(option, "=")
4848

4949
if (islong && pos >= 0) || (!islong && pos == 1) {

parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ func (p *Parser) ParseArgs(args []string) ([]string, error) {
279279
continue
280280
}
281281

282-
prefix, optname, islong := stripOptionPrefix(arg)
283-
optname, _, argument := splitOption(prefix, optname, islong)
282+
_, optname, islong := stripOptionPrefix(arg)
283+
optname, _, argument := splitOption(optname, islong)
284284

285285
if islong {
286286
err = p.parseLong(s, optname, argument)

0 commit comments

Comments
 (0)
0