Repository navigation
Commit 1d89fa0
committed
fix(main): guard initConfig against missing os.Args[1]
When talm is invoked with no arguments, os.Args only contains the program
name. initConfig() runs via cobra.OnInitialize() before normal command
handling, so reading os.Args[1] without checking length panics on plain
`talm` invocation.
Return early when len(os.Args) < 2.
Signed-off-by: Aleksei Sviridkin <[email protected]>1 parent 3b4710e commit 1d89fa0
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
0 commit comments