code: func (flag *ClientFlag) WithCancel(ctx context.Context, f func(context.Context) error) error {
  	sig := make(chan os.Signal, 1)
  	signal.Notify(sig, syscall.SIGINT)
  
  	wctx, cancel := context.WithCancel(ctx)
  	defer cancel()
  
  	done := make(chan bool)
  	var werr error
  
  	go func() {
  		defer close(done)
  		werr = f(wctx)
  	}()
  
  	select {
  	case <-sig:
  		cancel()
  		<-done // Wait for f() to complete
  	case <-done:
  	}
  
  	return werr
  }
docs: // WithCancel calls the given function, returning when complete or canceled via SIGINT.