b7fffc9c5113e5f4ae1a6fedf007ae8d083a596c
[nit.git] / share / man / nitls.md
1 # NAME
2
3 nitls - lists the projects, groups and paths of Nit sources files.
4
5 # SYNOPSIS
6
7 nitls [*options*] [*FILE*]...
8
9 # DESCRIPTION
10
11 `nitls` is used to list Nit files in directories and extract the module-group-project relation.
12
13 It is basically a `ls` or a simple `find` specialized on `.nit` source files.
14
15 By default `nitls` works with the current directory (`.`).
16
17 Each file can then be:
18
19 * A Nit module (file).
20   In this case, only this single module is considered
21 * A Nit group (directory).
22   In this case, all the modules of the groups (and recursively the sub-groups) are considered
23 * A normal directory.
24   In this case, all its entries are analysed.
25   Files that are Nit modules and directories that are Nit groups are considered.
26   Other files and directories are ignored.
27
28 # EXAMPLES
29
30 Show the tree of modules from the current directory.
31
32     $ nitls -t
33
34 Show the list of projects imported by the modules of the current directory.
35
36     $ nitls -d -P *.nit
37
38 # OPTIONS
39
40 Each combination of option
41
42 ## PRESENTATION MODE
43
44 Three presentation modes are available.
45
46 ### `-P`, `--project`
47 List projects in a flat list (default).
48
49 Only project are displayed (and not the individual files).
50
51 ### `-t`, `--tree`
52 List source files in their groups and projects.
53
54 Each `.nit` file is presented in a tree of projects and groups.
55
56 ### `-s`, `--source`
57 List source files in a flat list.
58
59 Each `.nit` file is presented indivitually.
60
61 The three modes are exclusives.
62
63 The default mode is `--project` unless one on the argument is a group, then it is `--group`.
64
65 ## COLLECT
66
67 ### `-r`, `--recursive`
68 Process directories recursively.
69
70 All `.nit` files found in the specified directory and subdirectories are considered.
71
72 ### `-d`, `--depends`
73 List dependencies of given modules
74
75 All imported modules are also considered.
76
77 In --tree and --source modes, the modules direclty imported are also displayed.
78
79 ### `-k`, `--keep`
80 Ignore errors and files that are not a Nit source file.
81
82 When a file that is not a valid Nit module is encoutered, it is ignored and the rest of the files are
83 processed.
84
85 Without this option, an error message is displayed and nitls terminates on such a case.
86
87 ## PRESENTATION OPTIONS
88
89 ### `-p`, `--path`
90 List only path (instead of name + path).
91
92 Paths are displayed uncolored.
93
94 ### `-M`
95 List dependencies suitable for a rule in a Makefile.
96
97 Alias for `-d`, `-p` and `-s`.
98
99 # SEE ALSO
100
101 The Nit language documentation and the source code of its tools and libraries may be downloaded from <http://nitlanguage.org>