Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d7cba72

Browse files
author
curtain
committed
tune: use submit for more meaningful
1 parent 38fbeee commit d7cba72

File tree

6 files changed

+31
-32
lines changed

6 files changed

+31
-32
lines changed

‎README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ FLAGS:
3838
SUBCOMMANDS:
3939
data Manage Cache [aliases: d]
4040
edit Edit question by id [aliases: e]
41-
exec Submit solution [aliases: x]
41+
submit Submit solution [aliases: s]
4242
list List problems [aliases: l]
4343
pick Pick a problem [aliases: p]
44-
stat Show simple chart about submissions [aliases: s]
44+
stat Show simple chart about submissions
4545
test Edit question by id [aliases: t]
4646
help Prints this message or the help of the given subcommand(s)
4747
```
@@ -123,10 +123,10 @@ leetcode test 1
123123

124124
```
125125

126-
#### 4. <kbd>exec</kbd>
126+
#### 4. <kbd>submit</kbd>
127127

128128
```sh
129-
leetcode exec 1
129+
leetcode submit 1
130130
```
131131

132132
```sh

‎src/cli.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Clap Commanders
22
use crate::{
33
cmds::{
4-
Command, DataCommand, EditCommand, ExecCommand,ListCommand, PickCommand, StatCommand,
4+
Command, DataCommand, EditCommand, ListCommand, PickCommand, StatCommand,SubmitCommand,
55
TestCommand,
66
},
77
err::Error,
@@ -31,12 +31,12 @@ pub async fn main() -> Result<(), Error> {
3131
.about("May the Code be with You 👻")
3232
.subcommands(vec![
3333
DataCommand::usage().display_order(1),
34-
EditCommand::usage().display_order(2),
35-
ExecCommand::usage().display_order(3),
36-
ListCommand::usage().display_order(4),
37-
PickCommand::usage().display_order(5),
38-
StatCommand::usage().display_order(6),
39-
TestCommand::usage().display_order(7),
34+
ListCommand::usage().display_order(2),
35+
PickCommand::usage().display_order(3),
36+
EditCommand::usage().display_order(4),
37+
TestCommand::usage().display_order(5),
38+
SubmitCommand::usage().display_order(6),
39+
StatCommand::usage().display_order(7),
4040
])
4141
.arg(Debug::usage())
4242
.arg_required_else_help(true)
@@ -53,12 +53,12 @@ pub async fn main() -> Result<(), Error> {
5353

5454
match m.subcommand() {
5555
Some(("data", sub_m)) => Ok(DataCommand::handler(sub_m).await?),
56-
Some(("edit", sub_m)) => Ok(EditCommand::handler(sub_m).await?),
57-
Some(("exec", sub_m)) => Ok(ExecCommand::handler(sub_m).await?),
5856
Some(("list", sub_m)) => Ok(ListCommand::handler(sub_m).await?),
5957
Some(("pick", sub_m)) => Ok(PickCommand::handler(sub_m).await?),
60-
Some(("stat", sub_m)) => Ok(StatCommand::handler(sub_m).await?),
58+
Some(("edit", sub_m)) => Ok(EditCommand::handler(sub_m).await?),
6159
Some(("test", sub_m)) => Ok(TestCommand::handler(sub_m).await?),
60+
Some(("submit", sub_m)) => Ok(SubmitCommand::handler(sub_m).await?),
61+
Some(("stat", sub_m)) => Ok(StatCommand::handler(sub_m).await?),
6262
_ => Err(Error::MatchError),
6363
}
6464
}

‎src/cmds/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
//! SUBCOMMANDS:
55
//! data Manage Cache [aliases: d]
66
//! edit Edit question by id [aliases: e]
7+
//! submit Submit question by id [aliases: s]
78
//! list List problems [aliases: l]
89
//! pick Pick a problem [aliases: p]
9-
//! stat Show simple chart about submissions [aliases: s]
10+
//! stat Show simple chart about submissions
1011
//! test Edit question by id [aliases: t]
1112
//! help Prints this message or the help of the given subcommand(s)
1213
//! ```
@@ -26,15 +27,15 @@ pub trait Command {
2627

2728
mod data;
2829
mod edit;
29-
mod exec;
3030
mod list;
3131
mod pick;
3232
mod stat;
33+
mod submit;
3334
mod test;
3435
pub use data::DataCommand;
3536
pub use edit::EditCommand;
36-
pub use exec::ExecCommand;
3737
pub use list::ListCommand;
3838
pub use pick::PickCommand;
3939
pub use stat::StatCommand;
40+
pub use submit::SubmitCommand;
4041
pub use test::TestCommand;

‎src/cmds/stat.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ pub struct StatCommand;
2323
impl Command for StatCommand {
2424
/// `stat` usage
2525
fn usage() -> ClapCommand {
26-
ClapCommand::new("stat")
27-
.about("Show simple chart about submissions")
28-
.visible_alias("s")
26+
ClapCommand::new("stat").about("Show simple chart about submissions")
2927
}
3028

3129
/// `stat` handler

‎src/cmds/exec.rs renamed to ‎src/cmds/submit.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
//! Exec command
1+
//! Submit command
22
use super::Command;
33
use crate::Error;
44
use async_trait::async_trait;
55
use clap::{Arg, ArgMatches, Command as ClapCommand};
66

7-
/// Abstract Exec Command
7+
/// Abstract Submit Command
88
///
99
/// ```sh
10-
/// leetcode-exec
10+
/// leetcode-submit
1111
/// Submit solution
1212
///
1313
/// USAGE:
14-
/// leetcode exec <id>
14+
/// leetcode submit <id>
1515
///
1616
/// FLAGS:
1717
/// -h, --help Prints help information
@@ -20,15 +20,15 @@ use clap::{Arg, ArgMatches, Command as ClapCommand};
2020
/// ARGS:
2121
/// <id> question id
2222
/// ```
23-
pub struct ExecCommand;
23+
pub struct SubmitCommand;
2424

2525
#[async_trait]
26-
impl Command for ExecCommand {
27-
/// `exec` usage
26+
impl Command for SubmitCommand {
27+
/// `submit` usage
2828
fn usage() -> ClapCommand {
29-
ClapCommand::new("exec")
29+
ClapCommand::new("submit")
3030
.about("Submit solution")
31-
.visible_alias("x")
31+
.visible_alias("s")
3232
.arg(
3333
Arg::new("id")
3434
.num_args(1)
@@ -38,7 +38,7 @@ impl Command for ExecCommand {
3838
)
3939
}
4040

41-
/// `exec` handler
41+
/// `submit` handler
4242
async fn handler(m: &ArgMatches) -> Result<(), crate::Error> {
4343
use crate::cache::{Cache, Run};
4444

‎src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
//! SUBCOMMANDS:
3030
//! data Manage Cache [aliases: d]
3131
//! edit Edit question by id [aliases: e]
32-
//! exec Submit solution [aliases: x]
32+
//! submit Submit solution [aliases: s]
3333
//! list List problems [aliases: l]
3434
//! pick Pick a problem [aliases: p]
35-
//! stat Show simple chart about submissions [aliases: s]
35+
//! stat Show simple chart about submissions
3636
//! test Edit question by id [aliases: t]
3737
//! help Prints this message or the help of the given subcommand(s)
3838
//! ```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /