commands/systemd: init
This commit is contained in:
31
commands/systemd.ts
Normal file
31
commands/systemd.ts
Normal file
@@ -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),
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user