@narumitw/pi-caffeinate 0.6.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/caffeinate.ts +8 -8
package/package.json
CHANGED
package/src/caffeinate.ts
CHANGED
|
@@ -19,12 +19,12 @@ const SETTINGS_FILE = join(
|
|
|
19
19
|
"pi-caffeinate-settings.json",
|
|
20
20
|
);
|
|
21
21
|
const COMMAND_COMPLETIONS = [
|
|
22
|
-
{ value: "display", label: "Keep system and display awake" },
|
|
23
|
-
{ value: "sleep", label: "Keep system awake; allow display sleep" },
|
|
24
|
-
{ value: "status", label: "Show current status" },
|
|
25
|
-
{ value: "mode", label: "Choose keep-awake mode" },
|
|
26
|
-
{ value: "stop", label: "Release inhibitor for now" },
|
|
27
|
-
{ value: "help", label: "Show command help" },
|
|
22
|
+
{ value: "display", label: "display", description: "Keep system and display awake" },
|
|
23
|
+
{ value: "sleep", label: "sleep", description: "Keep system awake; allow display sleep" },
|
|
24
|
+
{ value: "status", label: "status", description: "Show current status" },
|
|
25
|
+
{ value: "mode", label: "mode", description: "Choose keep-awake mode" },
|
|
26
|
+
{ value: "stop", label: "stop", description: "Release inhibitor for now" },
|
|
27
|
+
{ value: "help", label: "help", description: "Show command help" },
|
|
28
28
|
];
|
|
29
29
|
const MENU_OPTIONS = {
|
|
30
30
|
display: "Keep system and display awake",
|
|
@@ -246,8 +246,8 @@ export function parseCommand(args: string): CommandAction | "unknown" {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
export function commandCompletions(prefix: string) {
|
|
249
|
-
const normalized = prefix.
|
|
250
|
-
if (normalized
|
|
249
|
+
const normalized = prefix.trimStart().toLowerCase();
|
|
250
|
+
if (/\s/.test(normalized)) return null;
|
|
251
251
|
|
|
252
252
|
const matches = COMMAND_COMPLETIONS.filter((completion) =>
|
|
253
253
|
completion.value.startsWith(normalized),
|