@timmy6942025/cli-timer 1.1.10 → 1.1.11

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/README.md CHANGED
@@ -69,6 +69,12 @@ To list only timer-compatible fonts (fonts that render `01:23:45` visibly):
69
69
  timer style --compatible
70
70
  ```
71
71
 
72
+ To set a random font:
73
+
74
+ ```bash
75
+ timer style random
76
+ ```
77
+
72
78
  To set your preferred font:
73
79
 
74
80
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timmy6942025/cli-timer",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "Simple customizable terminal timer and stopwatch",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -1198,6 +1198,7 @@ function printUsage() {
1198
1198
  process.stdout.write(" timer style\n");
1199
1199
  process.stdout.write(" timer style --all\n");
1200
1200
  process.stdout.write(" timer style --compatible\n");
1201
+ process.stdout.write(" timer style random\n");
1201
1202
  process.stdout.write(" timer style <font>\n");
1202
1203
  }
1203
1204
 
@@ -1244,6 +1245,24 @@ function runTimer(args) {
1244
1245
  return;
1245
1246
  }
1246
1247
 
1248
+ if (args.length === 2 && args[1].toLowerCase() === "random") {
1249
+ const fonts = getAllFonts();
1250
+ if (fonts.length === 0) {
1251
+ process.stderr.write("No fonts are available.\n");
1252
+ process.exitCode = 1;
1253
+ return;
1254
+ }
1255
+ const randomFont = fonts[Math.floor(Math.random() * fonts.length)];
1256
+ const result = setFontInConfig(randomFont);
1257
+ if (!result.ok) {
1258
+ process.stderr.write(`Failed to set random font: ${randomFont}\n`);
1259
+ process.exitCode = 1;
1260
+ return;
1261
+ }
1262
+ process.stdout.write(`Random font set to: ${result.font}\n`);
1263
+ return;
1264
+ }
1265
+
1247
1266
  const requestedFont = args.slice(1).join(" ");
1248
1267
  const result = setFontInConfig(requestedFont);
1249
1268
  if (!result.ok) {