Skip to content

Commit 316e1a5

Browse files
committed
Updated the manual.
1 parent 9896fb7 commit 316e1a5

File tree

2 files changed

+50
-7
lines changed

2 files changed

+50
-7
lines changed

mostfiles/ctwig.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ Then you can show trees.
1010
For example you run:
1111
ctwig projects/myproj.pro -ct
1212
13+
1314
ADAP NOW
1415
-CT version >= 1.5 will be multi-project and multi-level
1516
17+
1618
ADAP FUT
1719
-CT version x.y - implement the objects?? not soon because they only beautify the code..
1820
v-design objects

mostfiles/manual_codetwig.txt

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ All commands follow a certain structure and style:
1313
Currently all commands require a project-definition-path, except for help:
1414
ctwig -h or ctwig --help
1515

16-
As option-separator one can use ':', '=' or none (for short options) and space (for long options)
16+
As option-separator one can use ':' and '='. Also a brief option-sep exists of none for short options and space for long options. Example short style: ctwig projects/someproject.pro -ct -rb -d4
17+
1718

1819
Below I will list the commands with possible (extra) options in the logical order of use.
1920
All commands are invoked as:
@@ -30,6 +31,10 @@ All codetwig-genererated files are placed in a newly created folder: projects/yo
3031
So the folder-name is based on the basename of your project-def-file.
3132

3233

34+
MULTI-PROJECTS
35+
After you have defined some projects in project-files (.pro), since CT 1.5x you can create a multi-project-definition (.mul) that enables you to show more projects at once; for now that is the trees of usage and used-by. (no views, for that you can look at the respective projects). Lateron the source-code-view will be added.
36+
37+
3338

3439
ALL COMMANDS
3540

@@ -39,7 +44,7 @@ no options
3944
Full example:
4045
ctwig projects/yourproject.pro -c:a
4146

42-
After you have copied the project-template, renamed it and adjusted the path to the source-files, you can run above command. All it does for now is adding the names of the source-files (.nim) from the source-path to project-def-file (yourproject.pro).
47+
After you have copied the project-template, renamed it and adjusted the path to the source-files, you can run above command. The operation adds the names of the source-files (.nim) from the source-path and (since 1.5x) underlying directories to project-def-file (yourproject.pro). You must manually prune backup- or test-files or other .nim-files that you want to exclude from the codetwig-analysis.
4348
---------------------------------------------------------------------------
4449

4550
-c:d or --command:declarations
@@ -52,7 +57,7 @@ Running this command will create a list of declarations. Declarations are the va
5257
- declarations (like procs) for all source-files
5358
- declarations that are used in above declarations (these are appended to above line)
5459

55-
The arise of the dec-list happens in three phases, whereby phase 3 is the version that is used by other functions.
60+
The arise of the dec-list happens in three phases, whereby phase 3 is the version that is used by other functions. Since CT 1.5x a field with the project-name is added to enable multi-project trees. (command:combine will tell more on that).
5661
---------------------------------------------------------------------------
5762

5863
-c:v or --command:views
@@ -61,7 +66,7 @@ no options
6166
Full example:
6267
ctwig projects/yourproject.pro -c:v
6368

64-
Running this command will create some views of the source-code. Currently four views are available, basic and extended view with one level or two levels. The one-level-files show the source-files and the declarations only (usually mostly procs), and the two-level-files shows the (first-level) usages of each declaration (used procs). The extended ones provide also the parameters of function and the added comment.
69+
Running this command will create some views of the source-code. Currently four views are available, basic and extended view with one level or two levels. The one-level-files show the source-files and the declarations only (usually mostly procs), and the two-level-files shows the (first-level) usages of each declaration (that is mostly the used procs). The extended ones provide also the parameters of function and the added comment.
6570

6671
So you get:
6772
yourproject_basic_one-level_view.txt
@@ -76,9 +81,22 @@ no options
7681
Full example:
7782
ctwig projects/yourproject.pro -c:g
7883

79-
This command generates both the declaration-list and all of the views. Use it if you want to update your project and are not interested in the output screen-notification.
84+
This command generates both the declaration-list and all of the views for a project. Use it if you want to update your project and are not interested in the output screen-notifications of the dec-list.
8085
---------------------------------------------------------------------------
8186

87+
88+
89+
-c:c or --command:combine
90+
91+
After you have defined some projects in project-files (.pro), since CT 1.5x you can create a multi-project-definition (.mul) that enables you to show more projects at once; for now that is the trees of usage and used-by.
92+
93+
To create a multi-project declaration-list do the following:
94+
-create and update the individual projects you want to include in below list.
95+
-run the command: ./ctwig projects/your_multiproject.mul -c:c
96+
-the command creates a directory and concatenates the dec-lists of the individual projects into one with a similar naming-convention. (mymultiproject.mul generates a subdir mymultiproject)
97+
98+
99+
---------------------------------------------------------------------------
82100
-c:t or --command:tree
83101
options:
84102
* direction
@@ -92,14 +110,37 @@ ctwig projects/yourproject.pro -c:t -r:b -d:4
92110
ctwig projects/yourproject.pro -c:t -r:u -d:2
93111
ctwig projects/yourproject.pro -c:t (using the defaults)
94112

113+
And since 1.5x:
114+
ctwig projects/yourmultiproject.mul -c:t
115+
95116
Seps can be ommitted:
96117
ctwig projects/yourproject.pro -ct -ru -d2
97118

98119

99120
Lastly above command starts with a box in which a substring can be entered to search for a declaration. Then a list of declarations is displayed which have the substring in them. If the entered substring matches only one declaration, a tree is shown based on the parameters direction and depth. The direction usage refers to the calls to other procs that are made in the proc, where used-by stands for all the procs that are using the declaration (so the reverse process). The depths stands for the number of levels that are shown.
100121

101-
As off CT 0.35 you can add a semi-column to indicate not only declaration but module as well, like so:
122+
Also now declarational arguments and comments are added to the chosen declaration.
123+
124+
Since CT 0.35 you can add a semi-column to indicate not only declaration but module as well, like so:
102125
declaration;module
103126
This is needed to show same-named decs.
127+
Since CT 1.5x you can also enter a projectname, which is usefull for the multiproject-case, like so:
128+
declaration;module;project
129+
130+
Omitting things means a wildcard. A tilde ~ prepended or postpended means exact-match (but case-insensitive).
131+
132+
Examples:
133+
134+
- entering nothing returns all decs
135+
- ;; also means all decs
136+
- ;;someproject means all decs of someproject
137+
- ;somemodule; means all decs in somemodule of all projects
138+
139+
Defaultly the search is substring but sometimes you need an EXACT-MATCH, for example when you have myfunc and myfunction, for which the first one is a substring of the second one.
140+
- myfunc~ returns only that function (if unique in all projects); also allowed
141+
- ~myfunc
142+
- ~myfunc~ for who likes to type ;-)
143+
144+
145+
104146

105-
Also now declarational arguments and comment are added to the chosen declaration.

0 commit comments

Comments
 (0)