Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Bug: glab config crashes on run #60

Closed
svenk opened this issue Aug 6, 2020 · 7 comments
Closed

Bug: glab config crashes on run #60

svenk opened this issue Aug 6, 2020 · 7 comments

Comments

@svenk
Copy link

svenk commented Aug 6, 2020

me@localhost % glab config    


me@localhost % glab config --help

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6c16c0]

goroutine 1 [running]:
glab.Exec(0x7ffeb9c4a2ff, 0x6, 0xc000012e40, 0xc000012e70)
        glab/glab.go:101 +0x670
main.main()
        glab/cmd/glab/main.go:44 +0x36f

Description

Code actually crashes.

Expected Behavior

Some useful message

Actual Behavior

Possible Fix

Steps to Reproduce

See #59 for the setup how I built/installed glab.

Context

Your Environment

  • Version used:
  • Operating System and version:
@dougEfresh
Copy link

@profclems is there any reason why you didn't use a library to parse commands and args? For example,
cobra

@profclems
Copy link
Owner

me@localhost % glab config    


me@localhost % glab config --help

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6c16c0]

goroutine 1 [running]:
glab.Exec(0x7ffeb9c4a2ff, 0x6, 0xc000012e40, 0xc000012e70)
        glab/glab.go:101 +0x670
main.main()
        glab/cmd/glab/main.go:44 +0x36f

Description

Code actually crashes.

Expected Behavior

Some useful message

Actual Behavior

Possible Fix

Steps to Reproduce

See #59 for the setup how I built/installed glab.

Context

Your Environment

  • Version used:
  • Operating System and version:

I'll look at that... At the meantime, you can set your variables with

glab config global --token=xxxxxx  --url=https://gitlab.com

@profclems
Copy link
Owner

@profclems is there any reason why you didn't use a library to parse commands and args? For example,
cobra

I wanted a lot more flexibility. I've actually looked into cobra

@dougEfresh
Copy link

From looking at your code, cobra would handle all that you need. Its really flexible.

@dougEfresh
Copy link

the CLI world, these two statements are the same:
glab config --token=blah --url=https://gitlab.com
glab config --token blah --url https://gitlab.com
but your code doesn't support that.

@profclems
Copy link
Owner

I'll consider that! Thanks a lot

Or do you think you could open a quick PR to help with that? It'll be much appreciated

@dougEfresh
Copy link

I'll fork and open a PR

@profclems profclems changed the title Glab config not doing anything useful glab config crashes on run Aug 9, 2020
@profclems profclems changed the title glab config crashes on run Bug: glab config crashes on run Aug 9, 2020
profclems added a commit that referenced this issue Aug 9, 2020
Fix(crash): #60
Fix(help): #66
Fix(output): ansi style output on windows #54
Fix: #53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants