@kokiito0926/pseudoalias 0.0.3 → 0.0.4

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.
Files changed (2) hide show
  1. package/index.js +4 -24
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -22,14 +22,15 @@
22
22
  // そのような処理を実装するのであれば、os.homedir関数を用いればいいような気がする。
23
23
  // >> 2026/01/27 18:33.
24
24
 
25
- // >> $ node ./index.js --config example.js
26
- // >> $ node ./index.js --config example.js greetings
27
- // >> $ node ./index.js --config example.js addition 1 2
25
+ // >> $ ./index.js --config example.js
26
+ // >> $ ./index.js --config example.js greetings
27
+ // >> $ ./index.js --config example.js addition 1 2
28
28
 
29
29
  import { minimist, fs, path, argv } from "zx";
30
30
  import { pathToFileURL } from "node:url";
31
31
 
32
32
  const commands = argv._;
33
+ // console.log(commands);
33
34
 
34
35
  const args = minimist(process.argv.slice(2));
35
36
  const config = args.config;
@@ -38,15 +39,11 @@ const completion = args.completion;
38
39
  // console.log(args);
39
40
  // process.exit(0);
40
41
 
41
- // console.log("aaaa\nbbbb\ncccc");
42
- // process.exit(0);
43
-
44
42
  const targetFile = config;
45
43
  if (!targetFile) {
46
44
  process.exit(0);
47
45
  }
48
46
 
49
- // const targetPath = targetFile;
50
47
  const targetPath = path.resolve(targetFile);
51
48
  if (!targetPath) {
52
49
  process.exit(0);
@@ -61,36 +58,19 @@ try {
61
58
  // console.log(restArgs);
62
59
  // process.exit(0);
63
60
 
64
- // const prevWord = process.argv[process?.argv?.length - 1];
65
- // const currentWord = process.argv[process?.argv?.length - 2];
66
-
67
61
  if (completion) {
68
- // fs.writeFileSync("./temp.txt", prevWord, "utf-8");
69
- // fs.writeFileSync("./temp.txt", currentWord, "utf-8");
70
- // process.exit(0);
71
-
72
62
  const args2 = process.argv;
73
63
  const prevWord = args2[args2.length - 1];
74
64
  const currentWord = args2[args2.length - 2];
75
65
 
76
66
  if (prevWord === "pseudoalias") {
77
67
  const candidates = Object.keys(aliasModule).filter((k) => k !== "default");
78
- // const candidates = ["addition", "division", "greetings", "multiplication", "subtraction"];
79
-
80
68
  const filtered = candidates.filter((c) => c.startsWith(currentWord));
81
-
82
69
  if (filtered.length > 0) {
83
70
  console.log(filtered.join("\n"));
84
71
  }
85
72
  process.exit(0);
86
73
  }
87
-
88
- // if (prevWord === "pseudoalias") {
89
- // const availableFunctions = Object.keys(aliasModule).filter((k) => k !== "default");
90
- // console.log(availableFunctions.join("\n"));
91
- // process.exit(0);
92
- // }
93
-
94
74
  process.exit(0);
95
75
  }
96
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokiito0926/pseudoalias",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "description": "スードーエイリアス(pseudoalias)を用いれば、擬似的なエイリアスを作成することができます。",
6
6
  "keywords": [