Repository navigation
CLI Flag verbose
Manech Dubreil edited this page Oct 21, 2026
·
1 revision
Status: ✅ Implemented (#54)
Prints each step of the command on stderr, one line per step, prefixed with [verbose].
transf-orm --verbose convert schema.prisma
transf-orm convert schema.prisma --verbose # global flag: also accepted after the command
transf-orm --verbose convert schema.prisma > pivot.json- Steps go to stderr only: stdout keeps the command's real output (e.g. the JSON pivot),
byte-for-byte identical with or without
--verbose, so redirecting or piping stdout still produces valid JSON. - Without the flag, nothing extra is printed.
- The text is stable (no timings, no absolute paths — only the path given on the command line) so it can be snapshot-tested.
- Can be combined with
--debug.
$ transf-orm --verbose convert schema.prisma > pivot.json
[verbose] Detecting ORM format for schema.prisma
[verbose] Source ORM: Prisma
[verbose] Reading schema.prisma
[verbose] Importing schema with the Prisma importer
[verbose] Imported 11 tables, 1 views, 3 enums
[verbose] Writing canonical JSON pivot to stdout
With --from, the detection step is replaced by:
[verbose] Using ORM forced by --from: prisma
$ transf-orm --serveur --port 8080 --verbose
[verbose] Listening port: 8080
Starting transf-orm server on port 8080
-
GlobalConfig::verbose(crates/core/src/config.rs) carries the flag to both modes. -
crates/cli/src/lib.rs— thestep(config, message)helper prints[verbose] <message>witheprintln!whenconfig.verboseis set.run_convertcalls it at every step. -
crates/server/src/lib.rs— prints the listening port. - Tests in
crates/transf-orm/tests/dispatch.rs, on the fixturetests/fixtures/verbose.prisma:-
verbose_output_snapshot— exact comparison of the whole stderr output; -
verbose_with_from_reports_forced_orm; -
verbose_keeps_stdout_unchanged— stdout is identical with and without the flag; -
no_flag_prints_nothing_on_stderr.
-
Call step(config, ...) for anything the user should follow, and never use println! for
progress — stdout is reserved for the command's output. Internal details belong in
--debug logs instead. Update the snapshot test when the steps change.
← CLI
|
Manech DUBREIL dmanech@gmail.com |
Timéo TRÉGAROT timeo.tregarot@epitech.eu |
Aymeric JOUANNET-MIMY aymeric.jouannet-mimy@epitech.eu |
Esteban BOUYAULT-MIMY esteban.bouyault-yvanez@epitech.eu |
Arthur DRAHY arthur.drahy@epitech.eu |