1 个不稳定版本

使用旧的 Rust 2015

0.0.2 2017年4月2日

#1901开发工具

MIT 许可证

35KB
927

wan ∪・ω・∪

Build Status Build status License: MIT

注意:该项目处于开发中。可能会发生一些破坏性更改。

概述

wan 是用 Rust 编写的 Wandbox 命令行客户端。它提供了一种从命令行与 Wandbox 交互的方式。

安装

安装需要 Rust 工具链。如果您还没有安装 Rust 工具链,请访问 rustup 官方页面 下载安装程序。

$ cargo install --git https://github.com/ubnt-intrepid/wan.git

命令

wan compile<filename> [<filenames>...]

将代码发布到 Wandbox,并检索编译/执行结果。

参数

  • <filename>
  • <filenames>...

选项

  • --compiler=<compiler> - 编译器名称
    默认情况下,编译器名称会自动通过文件扩展名检测。

  • --options=<options> - 用于编译器的准备选项
    如果您想使用多个选项,请用逗号连接它们。

  • --compiler-options=<options> - 编译器的额外选项
    参数由空格连接。

  • --runtime-options=<options> - 传递给(编译后的)可执行文件的参数
    参数由空格连接。

  • --stdin=[stdin str] - 标准输入

  • --permlink - 生成 permlink

  • --browse - 打开 permlink URL

  • --verbose - 显示详细信息输出

示例

// hello.cpp
#include <iostream>
#include <vector>

int main(int argc, char* argv[]) {
  std::cout << "Hello, wandbox ^ω^" << std::endl;

  std::cout << "Runtime arguments:" << std::endl;
  int i = 0;
  for (auto&& arg: std::vector<char*>(argv, argv+argc)) {
    std::cout << i++ << ": " << arg << std::endl;
  }
  return 0;
}
$ wan compile hoge.cpp --compiler=clang-head --runtime-options="a b c"

wan list

从 Wandbox 获取编译器信息并将其列在标准输出中。

参数

  • none

选项

  • --name-only - 仅显示编译器名称

  • --name <name> - 通过编译器名称过滤(使用正则表达式格式)

  • --lang <lang> - 通过语言过滤(使用正则表达式格式)

示例

$ wan list

从 Wandbox 获取指定 permlink 的结果

参数

  • <link> - 永久链接

选项

  • none

示例

$ wan permlink xxxxxxxx

配置

配置文件位于 ~/.config/wan/config.json (或 Windows 上的 ~/AppData/Roaming/wan/config.json)。例如,如果您想使用本地 Wandbox 服务

{
  "url": "http://127.0.0.1:3500"
}

Wandbox

编辑器插件

命令行客户端

API

依赖项

~13–25MB
~399K SLoC