Merge: doc: fixed some typos and other misc. corrections
[nit.git] / share / man / nitls.md
index 705a099..14767cd 100644 (file)
-% NITLS(1)
-
 # NAME
 
-Lists the projects and/or paths of Nit sources files.
+nitls - search and lists the packages, groups and paths of Nit sources files.
 
-# SYNOPSYS
+# SYNOPSIS
 
-nitls [*options*]...
+nitls [*options*] [*FILE*]...
 
-# OPTIONS
+# DESCRIPTION
+
+`nitls` is used to search and list Nit files in directories and extract the module-group-package relation.
+
+It is basically a `ls`, a `which` or a simple `find` specialized on `.nit` source files.
+
+By default `nitls` works with the current directory (`.`).
+
+Each file can then be:
+
+* A Nit module (file).
+  In this case, only this single module is considered
+* A Nit group (directory).
+  In this case, all the modules of the groups (and recursively the sub-groups) are considered
+* A normal directory.
+  In this case, all its entries are analysed.
+  Files that are Nit modules and directories that are Nit groups are considered.
+  Other files and directories are ignored.
+
+# EXAMPLES
 
-`-W`, `--warn`
-:   Show more warnings
+Show the tree of modules from the current directory.
+
+    $ nitls
+    test_prog: Test program for model tools. (.)
+    |--game: Gaming group (./game)
+    |  `--game: A game abstraction for RPG. (./game/game.nit)
+    |--platform: Fictive Crappy Platform. (./platform)
+    |  `--platform: Declares base types allowed on the platform. (./platform/platform.nit)
+    |--rpg: Role Playing Game group (./rpg)
+    |  |--careers: Careers of the game. (./rpg/careers.nit)
+    |  |--character: Characters are playable entity in the world. (./rpg/character.nit)
+    |  |--combat: COmbat interactions between characters. (./rpg/combat.nit)
+    |  |--races: Races of the game. (./rpg/races.nit)
+    |  `--rpg: A worlg RPG abstraction. (./rpg/rpg.nit)
+    `--test_prog: A test program with a fake model to check model tools. (./test_prog.nit)
+
+
+Show the list of packages imported by the modules of the current directory.
+
+    $ nitls -d -P *.nit
+    base64: Offers the base 64 encoding and decoding algorithms (/home/privat/prog/nit/lib/base64.nit)
+    core: # Nit common library of core classes and methods (/home/privat/prog/nit/lib/core)
+    curl: Data transfer with URL syntax (/home/privat/prog/nit/lib/curl)
+    json (/home/privat/prog/nit/lib/json)
+    libevent: Low-level wrapper around the libevent library to manage events on file descriptors (/home/privat/prog/nit/lib/libevent.nit)
+    md5: Native MD5 digest implementation as `Text::md5` (/home/privat/prog/nit/lib/md5.nit)
+    more_collections: Highly specific, but useful, collections-related classes. (/home/privat/prog/nit/lib/more_collections.nit)
+    nitcc_runtime: Runtime library required by parsers and lexers generated by nitcc (/home/privat/prog/nit/lib/nitcc_runtime.nit)
+    nitcorn: Lightweight framework for Web applications development (.)
+    parser_base: Simple base for hand-made parsers of all kinds (/home/privat/prog/nit/lib/parser_base.nit)
+    performance_analysis: Services to gather information on the performance of events by categories (/home/privat/prog/nit/lib/performance_analysis.nit)
+    realtime: Services to keep time of the wall clock time (/home/privat/prog/nit/lib/realtime.nit)
+    serialization: # Abstract serialization services (/home/privat/prog/nit/lib/serialization)
+    template: Basic template system (/home/privat/prog/nit/lib/template)
+
+Show the directory of the package `inkscape_tools`.
+
+    $ nitls -pP inkscape_tools
+    /home/privat/prog/nit/contrib/inkscape_tools
+
+# OPTIONS
 
-`-w`, `--warning`
-:   Show/hide a specific warning
+Each combination of option
 
-`-q`, `--quiet`
-:   Do not show warnings
+## PRESENTATION MODE
 
-`--stop-on-first-error`
-:   Stop on first error
+Three presentation modes are available.
 
-`--no-color`
-:   Do not use color to display errors and warnings
+### `-P`, `--package`
+List packages in a flat list (default).
 
-`--log`
-:   Generate various log files
+Only package are displayed (and not the individual files).
 
-`--log-dir`
-:   Directory where to generate log files
+### `-t`, `--tree`
+List source files in their groups and packages.
 
-`-h`, `-?`, `--help`
-:   Show Help (This screen)
+Each `.nit` file is presented in a tree of packages and groups.
 
-`--version`
-:   Show version and exit
+### `-s`, `--source`
+List source files in a flat list.
 
-`--set-dummy-tool`
-:   Set toolname and version to DUMMY. Useful for testing
+Each `.nit` file is presented individually.
 
-`-v`, `--verbose`
-:   Verbose
+The three modes are exclusives.
 
-`--bash-completion`
-:   Generate bash_completion file for this program
+The default mode is `--package` unless one on the argument is a group, then it is `--group`.
 
-`--stub-man`
-:   Generate a stub manpage in pandoc markdown format
+## COLLECT
 
-`--disable-phase`
-:   DEBUG: Disable a specific phase; use `list` to get the list.
+### `-r`, `--recursive`
+Process directories recursively.
 
-`-I`, `--path`
-:   Set include path for loaders (may be used more than once)
+All `.nit` files found in the specified directory and subdirectories are considered.
 
-`--only-parse`
-:   Only proceed to parse step of loaders
+### `-d`, `--depends`
+List dependencies of given modules.
 
-`--only-metamodel`
-:   Stop after meta-model processing
+All imported modules are also considered.
 
-`--ignore-visibility`
-:   Do not check, and produce errors, on visibility issues.
+In --tree and --source modes, the modules directly imported are also displayed.
 
-`-k`, `--keep`
-:   Ignore errors and files that are not a Nit source file
+### `-k`, `--keep`
+Ignore errors and files that are not a Nit source file.
 
-`-r`, `--recursive`
-:   Process directories recussively
+When a file that is not a valid Nit module is encountered, it is ignored and the rest of the files are
+processed.
 
-`-t`, `--tree`
-:   List source files in their groups and projects
+Without this option, an error message is displayed and nitls terminates on such a case.
 
-`-s`, `--source`
-:   List source files
+## PRESENTATION OPTIONS
 
-`-P`, `--project`
-:   List projects paths (default)
+### `-p`, `--path-only`
+List only path (instead of name + path).
 
-`-d`, `--depends`
-:   List dependencies of given modules
+Paths are displayed uncolored.
 
-`-p`, `--path`
-:   List only path (instead of name + path)
+### `-M`
+List dependencies suitable for a rule in a Makefile.
 
-`-M`
-:   List dependencies suitable for a rule in a Makefile. Alias for -d, -p and -s
+Alias for `-d`, `-p` and `-s`.
 
 # SEE ALSO