Skip to content

Commit 3e397ae

Browse files
committed
v1.1.3b
1 parent eaea02c commit 3e397ae

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# visualizer (v1.1.3a)
1+
# visualizer (v1.1.3b)
22

33
This project aims to make a quick visual representation for a C++ project (though Python support is planned).
44

@@ -22,7 +22,7 @@ sudo apt install libclang-11-dev
2222
python3 visualizer.py cpp --target examples/segment_tree --scale 0.5
2323
```
2424

25-
You can also use `--bruteforce 1` to avoid errors.
25+
**You can also use `-b` or `--bruteforce` to avoid errors.**
2626

2727
## Keyboard control:
2828

@@ -73,6 +73,10 @@ Alpha patch:
7373
* Various code improvements
7474
* Added FPS meter to verbose mode
7575

76+
Bravo patch:
77+
78+
* Made better command line arguments for verbose and bruteforce modes
79+
7680
# Known bugs // missing features:
7781
* Function calls inside Loop and If conditions are not registered
7882
* No way to see actual code from visualizer

visualizer.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import argparse
2+
import sys
3+
24
import visualizer
35

46
if __name__ == '__main__':
@@ -8,19 +10,19 @@
810
help='Directory / file to parse')
911
argument_parser.add_argument('--scale', required=False, default=1, type=float,
1012
help='Scale of all objects')
11-
argument_parser.add_argument('--bruteforce', required=False, default=False, type=bool,
13+
argument_parser.add_argument('-b', '--bruteforce', action='store_true',
1214
help='If true, enters \'brute-force\' mode '
1315
'and tries to ignore as many errors as possible')
14-
argument_parser.add_argument('--v', required=False, default=False, type=bool,
15-
help='Verbose mode - prints more information')
16+
argument_parser.add_argument('-v', '--verbose', action='store_true',
17+
help='Verbose mode - prints more information, useful for debugging')
1618

1719
args = argument_parser.parse_args()
1820

1921
viz = visualizer.Visualizer(args.scale)
2022

2123
if args.mode == 'cpp':
22-
viz.parse(args.target, visualizer.ParseModes.CPP, args.bruteforce, args.v)
24+
viz.parse(args.target, visualizer.ParseModes.CPP, args.bruteforce, args.verbose)
2325
elif args.mode == 'py':
24-
viz.parse(args.target, visualizer.ParseModes.PYTHON, args.bruteforce, args.v)
26+
viz.parse(args.target, visualizer.ParseModes.PYTHON, args.bruteforce, args.verbose)
2527

2628
viz.run()

0 commit comments

Comments
 (0)