()
| 198 | } |
| 199 | |
| 200 | func contextWithCancel() context.Context { |
| 201 | ctx, cancel := context.WithCancel(context.Background()) |
| 202 | |
| 203 | ch := make(chan os.Signal, 1) |
| 204 | signal.Notify(ch, os.Interrupt) |
| 205 | |
| 206 | go func() { |
| 207 | <-ch |
| 208 | defer cancel() |
| 209 | os.Exit(0) |
| 210 | }() |
| 211 | |
| 212 | return ctx |
| 213 | } |
| 214 | |
| 215 | func overrideHelpAndVersionFlagText(cmd *cobra.Command) { |
| 216 | cmd.Flags().BoolP("version", "v", false, "Version for auth0.") |