Files
work-ts/commands/systemd.ts
2024-06-18 02:02:45 +08:00

32 lines
729 B
TypeScript

import { optFlag, optSwitch } from "./common";
export interface SystemdRunOptions {
/**
* Create a transient .scope unit instead of the default transient .service unit (see above).
*
* @since 206
*/
scope?: boolean;
/**
* Use this unit name instead of an automatically generated one.
*
* @since 206
*/
unit?: string;
/**
* Talk to the service manager of the calling user, rather than the service manager of the system.
*/
user?: boolean;
}
export function systemdRunOptions(o: SystemdRunOptions): string[] {
return [
...optSwitch("--scope", o.scope),
...optFlag("--unit", o.unit),
...optSwitch("--user", o.user),
];
}