Skip to content

Commit fcaae98

Browse files
committed
change args default values
1 parent 6d486f3 commit fcaae98

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
# actually_checked_typescript
2+
23
Add runtime type checking to your Typescript code
34

4-
Usage: ```actypes [OPTIONS] --folder-path <FOLDER_PATH> --patch-type <PATCH_TYPE>```
5+
Usage: `actypes [OPTIONS] [PATCH_TYPE]`
6+
7+
```
8+
Arguments:
9+
[PATCH_TYPE] [default: warning] [possible values: warning, error, fix]
10+
11+
```
12+
513
```
614
Options:
7-
-f, --folder-path <FOLDER_PATH>
8-
-o, --out-folder-path <OUT_FOLDER_PATH> [default: act_out]
9-
-p, --patch-type <PATCH_TYPE>
15+
-f, --folder-path <FOLDER_PATH> [default: .]
16+
-o, --out-folder-path <OUT_FOLDER_PATH> [default: .]
1017
-h, --help Print help
1118
-V, --version Print version
1219
```
13-

src/act_patch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use crate::{
88
args_parser::ActArgs,
99
patch_index_helper::PatchIndexHelper,
1010
};
11-
use clap::Parser;
11+
use clap::{Parser, ValueEnum};
1212

13-
#[derive(Debug, Clone)]
13+
#[derive(Debug, Clone, ValueEnum)]
1414
pub enum PatchType {
1515
Warning,
1616
Error,

src/args_parser.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use crate::act_patch::PatchType;
55
#[derive(Parser, Debug)]
66
#[command(author, version, about, long_about = None)]
77
pub struct ActArgs {
8-
#[arg(short, long)]
8+
#[arg(short, long, default_value = ".")]
99
pub folder_path: String,
1010

11-
#[arg(short, long, default_value = "act_out")]
11+
#[arg(short, long, default_value = ".")]
1212
pub out_folder_path: String,
1313

14-
#[arg(short, long)]
14+
#[arg(value_enum, default_value_t = PatchType::Warning)]
1515
pub patch_type: PatchType,
1616
}

0 commit comments

Comments
 (0)