├── .gitignore
├── doc
├── .gitignore
└── askpass.txt
├── denops
└── askpass
│ ├── const.ts
│ ├── cli.ts
│ └── main.ts
├── plugin
└── askpass.vim
├── deno.jsonc
├── .gitmessage
├── Makefile
├── LICENSE
├── .github
└── workflows
│ ├── udd.yml
│ └── test.yml
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /.deno
2 |
--------------------------------------------------------------------------------
/doc/.gitignore:
--------------------------------------------------------------------------------
1 | tags
2 |
--------------------------------------------------------------------------------
/denops/askpass/const.ts:
--------------------------------------------------------------------------------
1 | export const ASKPASS_ADDRESS = "ASKPASS_ADDRESS";
2 |
--------------------------------------------------------------------------------
/plugin/askpass.vim:
--------------------------------------------------------------------------------
1 | if exists('g:loaded_askpass')
2 | finish
3 | endif
4 | let g:loaded_askpass = 1
5 |
--------------------------------------------------------------------------------
/deno.jsonc:
--------------------------------------------------------------------------------
1 | {
2 | "lint": {
3 | "files": {
4 | "exclude": [".deno"]
5 | }
6 | },
7 | "fmt": {
8 | "files": {
9 | "exclude": [".deno"]
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/.gitmessage:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Guide (v1.0)
4 | #
5 | # 👍 :+1: Apply changes.
6 | #
7 | # 🌿 :herb: Add or update things for tests.
8 | # ☕ :coffee: Add or update things for developments.
9 | # 📦 :package: Add or update dependencies.
10 | # 📝 :memo: Add or update documentations.
11 | #
12 | # 🐛 :bug: Bugfixes.
13 | # 💋 :kiss: Critical hotfixes.
14 | # 🚿 :shower: Remove features, codes, or files.
15 | #
16 | # 🚀 :rocket: Improve performance.
17 | # 💪 :muscle: Refactor codes.
18 | # 💥 :boom: Breaking changes.
19 | # 💩 :poop: Bad codes needs to be improved.
20 | #
21 | # How to use:
22 | # git config commit.template .gitmessage
23 | #
24 | # Reference:
25 | # https://github.com/lambdalisue/emojiprefix
26 |
--------------------------------------------------------------------------------
/denops/askpass/cli.ts:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S deno run --no-check --allow-env=ASKPASS_ADDRESS --allow-net=127.0.0.1
2 | import { Session } from "https://deno.land/x/msgpack_rpc@v3.1.4/mod.ts";
3 | import { writeAll } from "https://deno.land/std@0.128.0/io/mod.ts";
4 | import { ASKPASS_ADDRESS } from "./const.ts";
5 |
6 | const addr = Deno.env.get(ASKPASS_ADDRESS);
7 | if (!addr) {
8 | throw new Error(`No ${ASKPASS_ADDRESS} environment variable found`);
9 | }
10 |
11 | const conn = await Deno.connect(JSON.parse(addr));
12 | const session = new Session(conn, conn);
13 | const input = await session.call("ask", Deno.args[0] ?? "") as string;
14 | const encoder = new TextEncoder();
15 | await writeAll(Deno.stdout, encoder.encode(input));
16 | session.close();
17 | conn.close();
18 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | TARGETS := $$(find . \( -name '*.ts' -or -name '*.md' \) -not -path './.deno/*')
2 |
3 | .DEFAULT_GOAL := help
4 |
5 | help:
6 | @cat $(MAKEFILE_LIST) | \
7 | perl -ne 'print if /^\w+.*##/;' | \
8 | perl -pe 's/(.*):.*##\s*/sprintf("%-20s",$$1)/eg;'
9 |
10 | fmt: FORCE ## Format code
11 | @deno fmt --config deno.jsonc
12 |
13 | fmt-check: FORCE ## Format check
14 | @deno fmt --check --config deno.jsonc
15 |
16 | lint: FORCE ## Lint code
17 | @deno lint --config deno.jsonc
18 |
19 | type-check: FORCE ## Type check
20 | @deno test --unstable --no-run ${TARGETS}
21 |
22 | test: FORCE ## Test
23 | @deno test --unstable -A --no-check --jobs
24 |
25 | deps: FORCE ## Update dependencies
26 | @deno run -A https://deno.land/x/udd@0.7.2/main.ts ${TARGETS}
27 | @make fmt
28 |
29 | FORCE:
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2021 Alisue, hashnote.net
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/doc/askpass.txt:
--------------------------------------------------------------------------------
1 | *askpass.txt* Use Vim/Neovim prompt for CLI user inputs
2 |
3 | Author: Alisue
17 |
18 | With lambdalisue/gin.vim
19 |