Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

oirepo

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oirepo

Simple tool for OIer to save C++ source file into repo and replace current file with template source file.

latest
npmnpm
Version
1.0.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

oirepo

介绍

oirepo是一个用Node.js构建的,为OI训练准备的自用小工具,可以通过简单的命令将当前源文件存入仓库、载入源文件模板、编译执行单个源文件并按照配置启用响应编译参数。避免手动复制源文件、切题时花时间在删代码或写#include、using namespace std、freopen之类的鬼地方上,还可以一键载入各种提前设定好的模板,比如快读模板、邻接表模板... 暂时想到这些功能233

使用oirepo的工作流(部分):

  • 当写出AC代码或反面教材或一题多解时,使用oirepo save xxx或直接orp s xxx,将当前源文件复制进repo(源文件仓库)的xxx.cpp
  • 当写出了一堆垃圾时,使用oirepo clear或直接orp c,清空当前源文件,并替换成默认模板文件。也可以在后面加上模板文件名来指定其它模板
  • 当AC了一道题,想要切题时,可以分别执行步骤1和2,也可使用oirepo push xxx或直接orp p xxx,将当前源文件复制进repo(源文件仓库)并用模板替换当前源文件
  • (待施工)想编译运行当前源文件,oirepo run或者orp r将使用预先配置好的命令编译并运行代码;也可以选择先将所有输入存进文件或流(用Ctrl+Z结束),再一次性传给待运行程序来模拟文件输入输出,计时并运行,输出结果和用时。
  • ...

oirepo需要配置一个repo(源文件仓库)文件夹,来存放写好的源文件;还有一个template(模板)文件夹,存放模板源文件,详见下文

快速入门

1. 安装Node.js

  • 通过访问网站:Node.js官网Node.js中文网获取安装包
  • 也可使用命令行,如apt-get,choco等工具

2. 安装oirepo

  • 从npm下载(推荐):
    • 通过命令行执行npm install oirepo -g直接将oirepo全局安装至本地,npm会自动下载所有依赖包
  • 从github获取源码包
    • 从github下载源码包并解压,或直接使用命令git clone https://github.com/CuberQAQ/oirepo.git(先确保安装了git)
    • 在源码目录下执行npm i -g,将oirepo全局安装至本地,npm会自动下载所有依赖包

3. 配置oirepo及更多

使用 oirepo helpoirepo help <子命令>来获取帮助...

Keywords

OI

FAQs

Package last updated on 11 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts