Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev curl #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# YuIndex - 极客范儿的浏览器主页

> Coolest browser index for geeks!
>
> Coolest browser index for geeks!
>
> 前后端全栈项目 By [程序员鱼皮](https://docs.qq.com/doc/DUFFRVWladXVjeUxW)


Expand Down Expand Up @@ -119,6 +119,7 @@ history
- 查看日期 date
- 翻译 fanyi
- 待办事项 todo
- 网络请求 curl
- 网络检测 ping
- 定时器 timing
- 更换背景 background
Expand Down
2 changes: 2 additions & 0 deletions src/core/commandRegister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import ikunCommand from "./commands/relax/ikun/ikunCommand";
import welcomeCommand from "./commands/terminal/config/welcomeCommand";
import hotCommand from "./commands/hot/hotCommand";
import ikuntestCommand from "./commands/relax/ikuntest/ikuntestCommand";
import curlCommand from "./commands/curl/curlCommand";
import varbookCommand from "./commands/varbook/varbookCommand";

/**
Expand Down Expand Up @@ -54,6 +55,7 @@ const commandList: CommandType[] = [
backgroundCommand,
resetCommand,
hintCommand,
curlCommand,
];

/**
Expand Down
59 changes: 59 additions & 0 deletions src/core/commands/curl/curlCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { CommandType } from "../../command";

/**
* cURL命令
* @author Eric-fuyc
*/
const curlCommand: CommandType = {
func: "curl",
name: "发送HTTP请求",
params: [
{
key: "url",
desc: "请求的URL",
required: false,
},
],
options: [
{
key: "fail",
desc: "失败时静默",
alias: ["f"],
type: "boolean",
required: false,
},
{
key: "include",
desc: "输出响应头",
alias: ["i"],
type: "boolean",
required: false,
},
{
key: "silent",
desc: "安静模式",
alias: ["s"],
type: "boolean",
required: false,
},
{
key: "request",
desc: "请求方法",
alias: ["X"],
type: "string",
required: false,
},
{
key: "header",
desc: "自定义请求头",
alias: ["H"],
type: "string",
required: false,
},
],
async action(options, terminal) {
terminal.writeTextErrorResult("尚未实现")
},
};

export default curlCommand;