@kokiito0926/pseudoalias 0.0.6 → 0.0.8

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 (3) hide show
  1. package/README.md +0 -6
  2. package/index.js +12 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -67,12 +67,6 @@ $ pseudoalias subtraction 2 1
67
67
  $ pseudoalias --unregister
68
68
  ```
69
69
 
70
- 下記のコマンドを.bashrcなどに追記すると、入力補完が効くようになります。
71
-
72
- ```bash
73
- $ complete -C "pseudoalias --completion" -o default pseudoalias
74
- ```
75
-
76
70
  ## ライセンス
77
71
 
78
72
  [MIT](LICENSE)
package/index.js CHANGED
@@ -31,7 +31,7 @@
31
31
  // >> $ ./index.js addition 1 2
32
32
  // >> $ ./index.js --unregister
33
33
 
34
- import { os, minimist, fs, path, argv } from "zx";
34
+ import { os, fs, path, argv } from "zx";
35
35
  import { pathToFileURL } from "node:url";
36
36
 
37
37
  const CONFIG_DIR = path.join(os.homedir(), ".pseudoalias");
@@ -40,16 +40,17 @@ const CONFIG_FILE = path.join(CONFIG_DIR, "config.js");
40
40
  const commands = argv._;
41
41
  // console.log(commands);
42
42
 
43
- const args = minimist(process.argv.slice(2));
44
- const config = args.config;
45
- const completion = args.completion;
43
+ const config = argv.config;
46
44
  // console.log(argv);
47
- // console.log(args);
48
45
  // process.exit(0);
49
46
 
50
- if (args.register) {
51
- if (args.config) {
52
- const absConfigPath = path.resolve(args.config);
47
+ /*
48
+ const completion = argv.completion;
49
+ */
50
+
51
+ if (argv.register) {
52
+ if (argv.config) {
53
+ const absConfigPath = path.resolve(argv.config);
53
54
  const configData = fs.readFileSync(absConfigPath, "utf-8");
54
55
 
55
56
  await fs.ensureDir(CONFIG_DIR);
@@ -64,7 +65,7 @@ if (args.register) {
64
65
  process.exit(0);
65
66
  }
66
67
 
67
- if (args.unregister) {
68
+ if (argv.unregister) {
68
69
  if (await fs.exists(CONFIG_DIR)) {
69
70
  await fs.remove(CONFIG_DIR);
70
71
  console.log("Success: Unregistered and removed configuration.");
@@ -100,6 +101,7 @@ try {
100
101
  // console.log(restArgs);
101
102
  // process.exit(0);
102
103
 
104
+ /*
103
105
  if (completion) {
104
106
  const args2 = process.argv;
105
107
  const prevWord = args2[args2.length - 1];
@@ -115,6 +117,7 @@ try {
115
117
  }
116
118
  process.exit(0);
117
119
  }
120
+ */
118
121
 
119
122
  if (!subCommand) {
120
123
  const availableFunctions = Object.keys(aliasModule).filter((k) => k !== "default");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokiito0926/pseudoalias",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "private": false,
5
5
  "description": "擬似的なエイリアスを作成することができるコマンドラインのツールです。",
6
6
  "keywords": [