From c95b33ae151703bc3e6f664658dc83bd64aa77c4 Mon Sep 17 00:00:00 2001 From: budougumi0617 Date: Tue, 29 Sep 2020 21:42:32 +0900 Subject: [PATCH] :shower: cleanup comments and documents --- README.md | 29 +++++++++++++++++------------ client.go | 2 -- core.go | 3 ++- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a6cc55e..b609090 100644 --- a/README.md +++ b/README.md @@ -28,28 +28,33 @@ export LEETCODE_TOKEN=${csrftoken} ## Usage ``` -leetgode -h -Usage of leetgode: -SUBCOMMANDS: - data Manage Cache [aliases: d] - edit Edit question by id [aliases: e] - exec Submit solution [aliases: x] - list List problems [aliases: l] - pick Pick a problem [aliases: p] - stat Show simple chart about submissions [aliases: s] - test Edit question by id [aliases: t] - help Prints this message or the help of the given subcommand(s) +leetgode help +Usage: leetgode is leetcode cli for gophers. + +SubCommands: + exec Submit solution + generate Generate the skeleton code with the test file by id + help Help shows usages + list List problems + pick Pick a problem by id + test Test solution ``` ## Install You can download binary from [release page](https://github.com/budougumi0617/leetgode/releases) and place it in $PATH directory. +### go get +``` +go get -u https://github.com/budougumi0617/leetgode/cmd/leetgode +``` + ### macOS -If you want to install on macOS, you can use Homebrew. +~~If you want to install on macOS, you can use Homebrew.~~ ``` brew install budougumi0617/tap/leetgode ``` +now setting... ## Contribution 1. Fork ([https://github.com/budougumi0617/leetgode/fork](https://github.com/budougumi0617/leetgode/fork)) diff --git a/client.go b/client.go index 913a5c6..b0f2959 100644 --- a/client.go +++ b/client.go @@ -137,8 +137,6 @@ query getQuestionDetail($titleSlug: String!) { return &q, nil } -// TODO: submitメソッドをつくる for exec - // curl https://leetcode.com/api/problems/algorithms/ func (lc *LeetCode) GetProblems(ctx context.Context) (*ProblemsResult, error) { cli := http.Client{ diff --git a/core.go b/core.go index 9a87d15..eae60d8 100644 --- a/core.go +++ b/core.go @@ -33,6 +33,7 @@ var CmdMap = map[CmdName]Cmd{ } func buildPath(id, slug string) string { - format := "tmp/%s.%s.go" + // TODO: changeable directory + format := "%s.%s.go" return fmt.Sprintf(format, id, slug) }