Skip to content

Commit

Permalink
doc: 补充 cli工具的文档
Browse files Browse the repository at this point in the history
  • Loading branch information
muzea committed Apr 10, 2019
1 parent 2f14c34 commit e6be4f5
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 2 deletions.
68 changes: 68 additions & 0 deletions BIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## 安装

via npm
```shell
npm -g i @woodenfish/random-data
```

via yarn
```shell
yarn global add @woodenfish/random-data
```

## 使用

### 在哪

程序总是在**当前目录**下生成测试数据。

比如我们要在 `test` 这个目录下生成测试数据,你需要准备两个文件

```shell
test
├── Main
└── template.txt
```

- `template.txt` 里面存放的是数据模板(类似 [graph示例](sample/graph.unlink.txt)
- `Main` 是标程的可执行文件(可以没有,就不会生成测试输出了,也就是没有`XXXX.out`

### 参数

只有一个参数,指明生成几份测试数据

### 示例

比如我们在 `test` 目录里面执行

```
random-data 10
```

将会得到

```
test
├── Main
├── template.10.in
├── template.10.out
├── template.1.in
├── template.1.out
├── template.2.in
├── template.2.out
├── template.3.in
├── template.3.out
├── template.4.in
├── template.4.out
├── template.5.in
├── template.5.out
├── template.6.in
├── template.6.out
├── template.7.in
├── template.7.out
├── template.8.in
├── template.8.out
├── template.9.in
├── template.9.out
└── template.txt
```
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.5

1. 实现了一个简单的 cli 工具

因实际代码并未变更,所以没有上个版本的在线回顾。

## 0.0.4

1. 增加了一个新的约束类型 `alias`
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

这是一个字符串拼接工具,可以用于OJ的测试数据生成, [点我在线体验](https://muzea-demo.github.io/random-data/)

cli 工具用法见 [cli使用指北](BIN.md)

- [语法](#语法)
- [constraint 的语法](#constraint-的语法)
- [int类型](#int类型)
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@woodenfish/random-data",
"version": "0.0.4",
"version": "0.0.5",
"description": "随机数据产生姬",
"main": "cli.js",
"bin": {
Expand All @@ -26,5 +26,6 @@
"bugs": {
"url": "https://github.com/muzea-demo/random-data/issues"
},
"homepage": "https://github.com/muzea-demo/random-data#readme"
"homepage": "https://github.com/muzea-demo/random-data#readme",
"keywords": ["javascript", "template-string", "online-judge", "random"]
}

0 comments on commit e6be4f5

Please sign in to comment.