package signalctx

import (
	"context"
	"os"
	"os/signal"
)

func WithSignals(parent context.Context, sig ...os.Signal) (context.Context, context.CancelFunc) {
	if parent == nil {
		parent = context.Background()
	}
	return signal.NotifyContext(parent, sig...)
}
