diff --git a/commands/systemd.ts b/commands/systemd.ts new file mode 100644 index 0000000..7459481 --- /dev/null +++ b/commands/systemd.ts @@ -0,0 +1,31 @@ +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), + ]; +}