mirror of
https://github.com/taigrr/systemctl.git
synced 2026-03-09 00:14:38 -07:00
adds option structs, ready for Show implementation
This commit is contained in:
@@ -46,9 +46,11 @@ import (
|
||||
func main() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
userMode := false
|
||||
// Equivalent to `systemctl enable nginx` with a 10 second timeout
|
||||
err := systemctl.Enable(ctx, "nginx", userMode)
|
||||
opts := Options{
|
||||
usermode: false,
|
||||
}
|
||||
err := Enable(ctx, unit, opts)
|
||||
if err != nil {
|
||||
log.Fatalf("unable to enable unit %s: %v", "nginx", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user