Skip to content

Commit

Permalink
chore: rename project to codeforces-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
lcian committed May 7, 2024
1 parent 2f75b4b commit 07efa22
Show file tree
Hide file tree
Showing 33 changed files with 68 additions and 69 deletions.
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Codeforces Tool
# Codeforces CLI

[![Github release](https://img.shields.io/github/release/lcian/cf-tool.svg)](https://github.com/lcian/cf-tool/releases)
[![platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-blue.svg)](https://github.com/lcian/cf-tool/releases)
![Build](https://github.com/lcian/cf-tool/actions/workflows/build.yaml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/lcian/cf-tool)](https://goreportcard.com/report/github.com/lcian/cf-tool)
[![Github release](https://img.shields.io/github/release/lcian/codeforces-cli.svg)](https://github.com/lcian/codeforces-cli/releases)
[![platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-blue.svg)](https://github.com/lcian/codeforces-cli/releases)
![Build](https://github.com/lcian/codeforces-cli/actions/workflows/build.yaml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/lcian/codeforces-cli)](https://goreportcard.com/report/github.com/lcian/codeforces-cli)
[![Go Version](https://img.shields.io/badge/go-%3E%3D1.12-green.svg)](https://github.com/golang)
[![license](https://img.shields.io/badge/license-MIT-%23373737.svg)](https://raw.githubusercontent.com/lcian/cf-tool/master/LICENSE)
[![license](https://img.shields.io/badge/license-MIT-%23373737.svg)](https://raw.githubusercontent.com/lcian/codeforces-cli/master/LICENSE)

Codeforces Tool is a command-line interface tool for [Codeforces](https://codeforces.com).
Codeforces CLI is a command-line interface tool for the competitive programming platform [Codeforces](https://codeforces.com).

It's fast, small, cross-platform and powerful.

Expand All @@ -34,19 +34,19 @@ Pull requests are always welcome.

## Installation

You can download the pre-compiled binary file in [here](https://github.com/lcian/cf-tool/releases).
You can download the pre-compiled binary file in [here](https://github.com/lcian/codeforces-cli/releases).

Or you can use `go install`:

```sh
go install github.com/lcian/cf-tool@latest
go install github.com/lcian/codeforces-cli@latest
```

Or you can compile it from source **(go >= 1.22)**:

```sh
git clone https://github.com/lcian/cf-tool.git
cd cf-tool
git clone https://github.com/lcian/codeforces-cli.git
cd codeforces-cli
make
make install
```
Expand Down Expand Up @@ -129,7 +129,7 @@ Options:
ac The status of the submission is Accepted.
Examples:
cf config Configure the cf-tool.
cf config Configure the codeforces-cli.
cf submit cf will detect what you want to submit automatically.
cf submit -f a.cpp
cf submit https://codeforces.com/contest/100/A
Expand Down Expand Up @@ -176,7 +176,7 @@ Examples:
"a" of contest 100.
cf pull Pull the latest codes of current problem into current
path.
cf clone lcian Clone all codes of lcian.
cf clone lcian Clone all codes of lcian.
cf upgrade Upgrade the "cf" to the latest version from GitHub.
File:
Expand Down Expand Up @@ -233,8 +233,7 @@ $%s%$ Second (e.g. 00)
```

```cpp
/* Generated by powerful Codeforces Tool
* You can download the binary file in here https://github.com/lcian/cf-tool (Windows, macOS, Linux)
/* Generated by Codeforces CLI (https://github.com/lcian/codeforces-cli)
* Author: $%U%$
* Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/
Expand All @@ -256,7 +255,7 @@ int main() {

### I double click the program but it doesn't work

Codeforces Tool is a command-line tool. You should run it in terminal.
Codeforces CLI is a command-line tool. You should run it in the terminal.

### I cannot use `cf` command

Expand Down
10 changes: 5 additions & 5 deletions cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/fatih/color"
ansi "github.com/k0kubun/go-ansi"
"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/cmd"
"github.com/lcian/cf-tool/config"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/cmd"
"github.com/lcian/codeforces-cli/config"
"github.com/mitchellh/go-homedir"

docopt "github.com/docopt/docopt-go"
Expand All @@ -20,7 +20,7 @@ const configPath = "~/.cf/config"
const sessionPath = "~/.cf/session"

func main() {
usage := `Codeforces Tool $%version%$ (cf). https://github.com/lcian/cf-tool
usage := `Codeforces CLI $%version%$ (cf). https://github.com/lcian/codeforces-cli
You should run "cf config" to configure your handle, password and code
templates at first.
Expand Down Expand Up @@ -62,7 +62,7 @@ Options:
ac The status of the submission is Accepted.
Examples:
cf config Configure the cf-tool.
cf config Configure the codeforces-cli.
cf submit cf will detect what you want to submit automatically.
cf submit -f a.cpp
cf submit https://codeforces.com/contest/100/A
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path/filepath"

"github.com/fatih/color"
"github.com/lcian/cf-tool/cookiejar"
"github.com/lcian/codeforces-cli/cookiejar"
)

// Client codeforces client
Expand Down
2 changes: 1 addition & 1 deletion client/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/fatih/color"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"
)

type cloneData struct {
Expand Down
4 changes: 2 additions & 2 deletions client/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"syscall"

"github.com/fatih/color"
"github.com/lcian/cf-tool/cookiejar"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/cookiejar"
"github.com/lcian/codeforces-cli/util"
"golang.org/x/crypto/ssh/terminal"
)

Expand Down
2 changes: 1 addition & 1 deletion client/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"sync"

"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"

"github.com/k0kubun/go-ansi"

Expand Down
2 changes: 1 addition & 1 deletion client/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"regexp"
"strings"

"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"

"github.com/fatih/color"
)
Expand Down
2 changes: 1 addition & 1 deletion client/race.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"time"

"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"

"github.com/fatih/color"
ansi "github.com/k0kubun/go-ansi"
Expand Down
2 changes: 1 addition & 1 deletion client/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/PuerkitoBio/goquery"
"github.com/fatih/color"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"
)

// Register for a contest
Expand Down
2 changes: 1 addition & 1 deletion client/statis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"regexp"
"strings"

"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"
)

// StatisInfo statis information
Expand Down
2 changes: 1 addition & 1 deletion client/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"regexp"
"strings"

"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"

"github.com/fatih/color"
)
Expand Down
2 changes: 1 addition & 1 deletion client/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"time"

"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"

"github.com/PuerkitoBio/goquery"
"github.com/fatih/color"
Expand Down
4 changes: 2 additions & 2 deletions cmd/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"regexp"

"github.com/docopt/docopt-go"
"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
)

// ParsedArgs parsed arguments
Expand Down
4 changes: 2 additions & 2 deletions cmd/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cmd

import (
"github.com/fatih/color"
"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
"github.com/skratchdot/open-golang/open"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"os"

"github.com/lcian/cf-tool/client"
"github.com/lcian/codeforces-cli/client"
)

// Clone command
Expand Down
6 changes: 3 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/docopt/docopt-go"

"github.com/fatih/color"
"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
"github.com/lcian/codeforces-cli/util"
)

// Eval opts
Expand Down
6 changes: 3 additions & 3 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package cmd
import (
"github.com/fatih/color"
ansi "github.com/k0kubun/go-ansi"
"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
"github.com/lcian/codeforces-cli/util"
)

// Config command
Expand Down
2 changes: 1 addition & 1 deletion cmd/contests.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

"github.com/fatih/color"
"github.com/lcian/cf-tool/client"
"github.com/lcian/codeforces-cli/client"
"github.com/olekukonko/tablewriter"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

"github.com/fatih/color"
"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
"github.com/lcian/codeforces-cli/util"
)

func parseTemplate(source string, cln *client.Client) string {
Expand Down
2 changes: 1 addition & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/fatih/color"
ansi "github.com/k0kubun/go-ansi"
"github.com/lcian/cf-tool/client"
"github.com/lcian/codeforces-cli/client"
"github.com/olekukonko/tablewriter"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"path/filepath"

"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
)

// Parse command
Expand Down
2 changes: 1 addition & 1 deletion cmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"os"

"github.com/lcian/cf-tool/client"
"github.com/lcian/codeforces-cli/client"
)

// Pull command
Expand Down
4 changes: 2 additions & 2 deletions cmd/race.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"time"

"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
)

// Race command
Expand Down
2 changes: 1 addition & 1 deletion cmd/register.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lcian/cf-tool/client"
"github.com/lcian/codeforces-cli/client"
)

// Register command
Expand Down
4 changes: 2 additions & 2 deletions cmd/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"io/ioutil"

"github.com/lcian/cf-tool/client"
"github.com/lcian/cf-tool/config"
"github.com/lcian/codeforces-cli/client"
"github.com/lcian/codeforces-cli/config"
)

// Submit command
Expand Down
4 changes: 2 additions & 2 deletions cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

"github.com/fatih/color"
ansi "github.com/k0kubun/go-ansi"
"github.com/lcian/cf-tool/config"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/config"
"github.com/lcian/codeforces-cli/util"
"github.com/sergi/go-diff/diffmatchpatch"
"github.com/shirou/gopsutil/process"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/unregister.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lcian/cf-tool/client"
"github.com/lcian/codeforces-cli/client"
)

// Unregister command
Expand Down
6 changes: 3 additions & 3 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"time"

"github.com/fatih/color"
"github.com/lcian/cf-tool/util"
"github.com/lcian/codeforces-cli/util"
)

func less(a, b string) bool {
Expand Down Expand Up @@ -62,7 +62,7 @@ func getLatest() (version, note, ptime, url string, size uint, err error) {
return
}

resp, err := http.Get("https://api.github.com/repos/lcian/cf-tool/releases/latest")
resp, err := http.Get("https://api.github.com/repos/lcian/codeforces-cli/releases/latest")
if err != nil {
return
}
Expand All @@ -77,7 +77,7 @@ func getLatest() (version, note, ptime, url string, size uint, err error) {
note = result["body"].(string)
tm, _ := time.Parse("2006-01-02T15:04:05Z", result["published_at"].(string))
ptime = tm.In(time.Local).Format("2006-01-02 15:04")
url = fmt.Sprintf("https://github.com/lcian/cf-tool/releases/download/%v/cf_%v_%v_%v.zip", version, version, goos, arch)
url = fmt.Sprintf("https://github.com/lcian/codeforces-cli/releases/download/%v/cf_%v_%v_%v.zip", version, version, goos, arch)
assets, _ := result["assets"].([]interface{})
for _, tmp := range assets {
asset, _ := tmp.(map[string]interface{})
Expand Down
2 changes: 1 addition & 1 deletion cmd/watch.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lcian/cf-tool/client"
"github.com/lcian/codeforces-cli/client"
)

// Watch command
Expand Down
Loading

0 comments on commit 07efa22

Please sign in to comment.