You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: capture_windows.go
    path of file: ./repos/fibratus/cmd/fibratus/app/capture
    
    the code of the file until where you have to start completion: /*
 * Copyright 2019-2020 by Nedim Sabic Sabic
 * https:
    
func capture(cmd *cobra.Command, args []string) error {
	spin := spinner.Show("Snapshotting processes and handles")
	defer spin.Stop()
	// the capture will start after all system handles have been
	// enumerated. This gives us a chance to build the handle state
	// before writing the event stream.
	// Make sure to not wait more than a minute if system handle
	// enumeration got stuck or taking too much time to complete
	wait := make(chan struct{}, 1)
	deadline := time.AfterFunc(time.Minute, func() {
		wait <- struct{}{}
	})
	fn := func(total uint64, named uint64) {
		deadline.Stop()
		spin.Stop()
		wait <- struct{}{}
	}
	app, err := bootstrap.NewApp(cfg, bootstrap.WithSignals(), bootstrap.WithDebugPrivilege(),
		bootstrap.WithHandleSnapshotFn(fn))
	if err != nil {
		return err
	}
	<-wait
	if err := app.WriteCapture(args); err != nil {
		return multierror.Wrap(err, app.Shutdown())
	}
	spin = spinner.Show("Capturing")
	app.Wait()
	spin.Stop()
	return app.Shutdown()
}