5.4.1 • Published 6 years ago

urionlinejudge-cli v5.4.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

npm version CircleCI Dependency Status devDependency Status

URI Online Judge - CLI

The URI Online Judge command line utility makes it easy to submit problems, wait for the solution and fetch new problems via command line!

What is a command line utility?

A command line utility is one to be used from a shell (or commonly known as a Terminal). It receives input from this shell, and reports its output in the same shell.

Installing

$ npm install -g urionlinejudge-cli

Note: For a global install of -g urionlinejudge-cli, OSX/Linux users may need to prefix the command with sudo or can setup proper file permissions on OSX for npm to install without sudo.

Commands

submit <filepath> [number]

You can submit a problem solution to the URI Online Judge.

Options

OptionDefaultDescription
--language [language]pythonLanguage used for submitting. Options: c, c++, c#, java, python, python3, ruby, scala, js, java8, go, c99, kotlin, c++17 .

Example

$ urionlinejudge submit ./1001.py
# or
$ urionlinejudge submit ./file.py 1001
# or
$ urionlinejudge submit ./file.cpp 1001 --language c++

fetch <number> Working in Progress

You can fetch a problem description from the URI Online Judge and populate a template file with that description.

You have to add urionlinejudge::description to your template.

Options
OptionDefaultDescription
-t, --template [path]Use config.template valueTemplate filepath.
-o, --output [path]Current folderFile output path.
-f, --force-Overwrite existing files.

Example

You create one template and add // urionlinejudge::description at any place:

#include <iostream>

using namespace std;

// urionlinejudge::description

int main()
{
    // work here

    return 0;
}

Then you execute the fetch command passing your template path:

# get template path from configs
$ urionlinejudge fetch -n 1001
# overwrite the template path
$ urionlinejudge fetch -n 1001 -t ../templates/template.cpp
# overwrite existing files
$ urionlinejudge fetch -n 1001 -t ../templates/template.cpp -f
# save file at ../solutions/folder
$ urionlinejudge fetch -n 1001 -t ../templates/template.cpp -o ../solutions/folder

Then the CLI will fetch the problem description and create this file for you:

#include <iostream>

using namespace std;

/*
 * Title:
 * Extremely Basic
 *
 * Timelimit: 1
 *
 * Description:
 * Read 2 variables, named A and B and make the sum of these two variables,
 * assigning its result to the variable X. Print X as shown below. Print
 * endline after the result otherwise you will get “Presentation Error”.
 *
 * Input:
 * The input file will contain 2 integer numbers.
 *
 * Output:
 * Print X according to the following example, with a blank space before and
 * after the equal signal.
 *
 */

 int main()
 {
     // work here

     return 0;
 }

reset

You can reset your information.

Example

$ urionlinejudge reset
What is the full path for the template? ../uri/template.cpp
What is your email? matheus1401@gmail.com
What is your password? *******

[*] Success:
[*] Email: matheus1401@gmail.com
[*] Template: /Users/user/git/uri/template.cpp

Developing and Contributing

We'd love to get contributions from you! For a quick guide to getting your system setup for developing take a look at our Quickstart Guide. Once you are up and running, take a look at the Contribution Documents to see how to get your changes merged in.

License

See LICENSE file.

5.4.1

6 years ago

5.4.0

6 years ago

5.3.0

6 years ago

5.2.1

6 years ago

5.1.0

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago

4.3.0

8 years ago

4.2.0

8 years ago

4.1.2

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.0

8 years ago

3.2.0

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.4.0

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.0.1

9 years ago