Skip to content

Commit e91f507

Browse files
committed
docs: update usage
1 parent 5dad4d5 commit e91f507

File tree

2 files changed

+45
-24
lines changed

2 files changed

+45
-24
lines changed

README.md

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,67 @@ process:
1111
1. generate to opt
1212
2. call `ctags` with opt
1313
3. analysis ctags logs
14-
4. output resulse
14+
4. output result
1515

1616
language support:
1717

1818
- [x] Java
19-
- [x] C# (basic, not testing namespace)
19+
- [x] C#
2020
- [x] Cpp
2121
- [x] TypeScript
2222
- [x] Golang
2323
- [x] Rust (basic)
24+
- ... others by ctags
2425

2526
## Usage
2627

27-
### use binary
28+
```bash
29+
Modeling 0.5.0
30+
31+
USAGE:
32+
modeling [FLAGS] [OPTIONS]
33+
34+
FLAGS:
35+
-b, --by-modules multiple modules
36+
-f, --field-only only load field in methods
37+
-h, --help Prints help information
38+
-m, --merge merge for same method name
39+
-r, --remove-impl-suffix if class's field start with `IRepository` will become `Repository`
40+
-V, --version Prints version information
41+
-w, --without-parent without class inheritance
42+
43+
OPTIONS:
44+
-g, --grep <grep> by grep regex rules: for example: [default: ]
45+
-i, --input <input> input dir [default: .]
46+
-o, --output-type <output-type> support: puml, mermaid, graphviz with json [default: puml]
47+
-p, --packages <packages>... filter by packages, like: `com.phodal.modeling`
48+
-s, --suffixes <suffixes>... filter by suffixes, like: `java` for .java file
49+
```
50+
51+
### sample: Visualization
52+
53+
convert to image: `plantuml modeling.puml modeling.svg -tsvg`
54+
55+
or set output type to `graphviz`
56+
57+
```
58+
modeling --input=/youpath --field-only -o graphviz --remove-impl-suffix
59+
```
60+
61+
### sample: Grep with MVC
62+
63+
```
64+
modeling --input=/youpath/ --field-only --without-parent --grep ".*Service|.*Controller|.*Repository"
65+
```
66+
67+
## Library
2868
2969
```
3070
cargo install modeling
3171
modeling .
3272
```
3373
34-
### Library
74+
#### Library
3575
3676
```rust
3777
use modeling::{by_dir};
@@ -63,25 +103,6 @@ class Snake extends Animal {
63103
@enduml
64104
```
65105
66-
## Usage
67-
68-
- Modeling, create `model from source code by `ctags`.
69-
- Concepting, generate concepts from method name & class name.
70-
- Diffing, diff two different file.
71-
72-
## Samples
73-
74-
to image: `plantuml modeling.puml modeling.svg -tsvg`
75-
76-
### MVC only
77-
78-
```
79-
modeling --input=/youpath/ --field-only --without-parent --grep ".*Service|.*Controller|.*Repository"
80-
```
81-
82-
## with Graphviz
83-
84-
85106
86107
License
87108
---

src/bin/modeling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::ffi::OsStr;
1010
use modeling::render::graphviz_render::GraphvizRender;
1111

1212
#[derive(StructOpt, Debug, PartialEq, Clone)]
13-
#[structopt(name = "basic")]
13+
#[structopt(name = "Modeling")]
1414
struct Opts {
1515
/// merge for same method name
1616
#[structopt(short, long)]

0 commit comments

Comments
 (0)