mirror of
https://github.com/taigrr/systemctl.git
synced 2026-03-09 00:14:38 -07:00
feat: add optional variadic args to all commands (#8)
Allow callers to pass additional systemctl flags (e.g. --no-block, --force) via variadic string args on every exported function. This is backward-compatible: existing callers without extra args continue to work unchanged. Introduces a prepareArgs helper to centralize argument construction, replacing the duplicated args/UserMode pattern across all functions. Closes #2
This commit is contained in:
@@ -8,58 +8,58 @@ import (
|
||||
"github.com/taigrr/systemctl/properties"
|
||||
)
|
||||
|
||||
func daemonReload(ctx context.Context, opts Options) error {
|
||||
func daemonReload(_ context.Context, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func reenable(ctx context.Context, unit string, opts Options) error {
|
||||
func reenable(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func disable(ctx context.Context, unit string, opts Options) error {
|
||||
func disable(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func enable(ctx context.Context, unit string, opts Options) error {
|
||||
func enable(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func isActive(ctx context.Context, unit string, opts Options) (bool, error) {
|
||||
func isActive(_ context.Context, _ string, _ Options, _ ...string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func isEnabled(ctx context.Context, unit string, opts Options) (bool, error) {
|
||||
func isEnabled(_ context.Context, _ string, _ Options, _ ...string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func isFailed(ctx context.Context, unit string, opts Options) (bool, error) {
|
||||
func isFailed(_ context.Context, _ string, _ Options, _ ...string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func mask(ctx context.Context, unit string, opts Options) error {
|
||||
func mask(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func restart(ctx context.Context, unit string, opts Options) error {
|
||||
func restart(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func show(ctx context.Context, unit string, property properties.Property, opts Options) (string, error) {
|
||||
func show(_ context.Context, _ string, _ properties.Property, _ Options, _ ...string) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func start(ctx context.Context, unit string, opts Options) error {
|
||||
func start(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func status(ctx context.Context, unit string, opts Options) (string, error) {
|
||||
func status(_ context.Context, _ string, _ Options, _ ...string) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func stop(ctx context.Context, unit string, opts Options) error {
|
||||
func stop(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func unmask(ctx context.Context, unit string, opts Options) error {
|
||||
func unmask(_ context.Context, _ string, _ Options, _ ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user