Skip to content

Commit

Permalink
Merge pull request #406 from jessevdk/upgrade
Browse files Browse the repository at this point in the history
Upgrade
  • Loading branch information
jessevdk authored Jun 15, 2024
2 parents b244016 + 01b0873 commit 1898d83
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 258 deletions.
36 changes: 15 additions & 21 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,29 @@ name: Go

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- uses: actions/checkout@v4

- name: Build
run: go build -v ./...
- name: setup
uses: actions/setup-go@v4
with:
go-version: "1.20"

- name: Install dependencies
run: go get -v golang.org/x/lint/golint
- name: build
run: go build -v ./...

- name: Test
run: go test -v ./...
- name: test
run: go test -v ./...

- name: Format
run: exit $(gofmt -l . | wc -l)
- name: gofmt
run: exit $(gofmt -l . | wc -l)

- name: Linting
run: |
go tool vet -all=true -v=true . || true
$(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/golint ./...
- name: vet
run: go vet -all=true -v=true .
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ func (c *completion) complete(args []string) []Completion {
}

if argumentIsOption(arg) {
prefix, optname, islong := stripOptionPrefix(arg)
optname, _, argument := splitOption(prefix, optname, islong)
_, optname, islong := stripOptionPrefix(arg)
optname, _, argument := splitOption(optname, islong)

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

if argument == nil && !islong {
rname, n := utf8.DecodeRuneInString(optname)
Expand Down
Loading

2 comments on commit 1898d83

@loadit1
Copy link

@loadit1 loadit1 commented on 1898d83 Jun 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jessevdk This commit is breaking builds on Windows as splitOption(prefix string, option string, islong bool) in https://github.com/jessevdk/go-flags/blob/main/optstyle_windows.go still have 3 arguments

@jessevdk
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about, reverted that removal of "unused parameter"

Please # to comment.