You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mostfiles/manual_codetwig.txt
+48-7Lines changed: 48 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@ All commands follow a certain structure and style:
13
13
Currently all commands require a project-definition-path, except for help:
14
14
ctwig -h or ctwig --help
15
15
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
+
17
18
18
19
Below I will list the commands with possible (extra) options in the logical order of use.
19
20
All commands are invoked as:
@@ -30,6 +31,10 @@ All codetwig-genererated files are placed in a newly created folder: projects/yo
30
31
So the folder-name is based on the basename of your project-def-file.
31
32
32
33
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
+
33
38
34
39
ALL COMMANDS
35
40
@@ -39,7 +44,7 @@ no options
39
44
Full example:
40
45
ctwig projects/yourproject.pro -c:a
41
46
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.
@@ -52,7 +57,7 @@ Running this command will create a list of declarations. Declarations are the va
52
57
- declarations (like procs) for all source-files
53
58
- declarations that are used in above declarations (these are appended to above line)
54
59
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).
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.
65
70
66
71
So you get:
67
72
yourproject_basic_one-level_view.txt
@@ -76,9 +81,22 @@ no options
76
81
Full example:
77
82
ctwig projects/yourproject.pro -c:g
78
83
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.
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)
ctwig projects/yourproject.pro -c:t (using the defaults)
94
112
113
+
And since 1.5x:
114
+
ctwig projects/yourmultiproject.mul -c:t
115
+
95
116
Seps can be ommitted:
96
117
ctwig projects/yourproject.pro -ct -ru -d2
97
118
98
119
99
120
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.
100
121
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:
102
125
declaration;module
103
126
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
+
104
146
105
-
Also now declarational arguments and comment are added to the chosen declaration.
0 commit comments