Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
bug: fix index out of range when no parameter is given
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jul 19, 2018
1 parent 86ee2f0 commit 29113e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v0.3.1
* bug: fix index out of range when no flag is given

# v0.3.0
* feature: add parameter `-set-current-context=false` to be able to toggle the context overwrite ([#1](https://github.com/chrischdi/k8s-ctx-import/pull/1))
* bug: Fix `-help` and `-h` to exit and print usage
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func readConfig(path string) (*v1.Config, error) {

func main() {
flags.Parse(os.Args[1:])
if os.Args[1] == "-h" {
if len(os.Args) > 1 && os.Args[1] == "-h" {
os.Exit(1)
}

Expand Down

0 comments on commit 29113e2

Please sign in to comment.