Closed starper closed 5 years ago
Do you think that --debug
is a bit too broad of a name? What about something more specific, such as --no-purs-print
?
Also, if you are using something that runs build
internally (i.e. bundle
), you can use the -s
/--no-build
flag for the time being.
@JordanMartinez I used --debug
just as an example. I don't have any strong opinion about what name this flag should have.
But, as far as I understand, printing purs
commands was introduced mostly for debugging purposes (that's why I chose --debug
), so I'm not sure that it should be a default behaviour. I think message should be printed with --purs-print
, not hidden with --no-purs-print
.
@starper good points. I think the --debug
flag fits here (because this was introduced for debugging as you said)
I think message should be printed with --purs-print, not hidden with --no-purs-print.
Yeah, I agree. I later realized that --debug
provided an "opt-in" approach whereas mine was an "opt-out" approach.
@f-f I suggested something other than --debug
because I wondered whether there would be other debug-like flags you might want to add later. Using just --debug
means all of these flags would be enabled whereas using a single flag for each would control more aspects of things and provide simpler documentation.
For example, if --debug
now only includes the --purs-print
idea and later adds some other debug flag, it'll need to explain that the single flag does multiple things in the spago --help
output. If there are multiple single-aspect debug flags, then each would have its own explanation in the above output.
If I was guessing what flag I needed for more explicit messages on a Unix command (recognizing that Spago is cross platform) by first guess would be --verbose
. I wouldn't be surprised if --verbose
took some additional level so that --verbose 2
printed more information than --verbose 1
At the risk if bikesheding all the commands, I seem to recall an idea that Unix commands are supposed to be silent on success by default. Although I don't seem to be able to locate a source for that idea and it seems to have fallen out of fashion in recent years.
@JordanMartinez
@f-f I suggested something other than --debug because I wondered whether there would be other debug-like flags you might want to add later. Using just --debug means all of these flags would be enabled whereas using a single flag for each would control more aspects of things and provide simpler documentation.
"Debugging" is not a core part of the UX (i.e. daily usage), so I'd like to minimize the exposed surface as much as possible (because most of the times if you do spago -h
you want to see the actually useful features instead of reading through a list of debug flags).
Moreover, it's usually an "all or nothing" activity: when I troubleshoot a system I probably want the most output I can get. Of course there is such a thing as good signal-to-noise ratio, but to tweak it we can just add a logging level in the future, as @JamieBallingall suggested (think --debug 3
or --debug INFO
)
I opened #155 with the fix for this issue. The flag is called --debug
at the moment, but I'm open to good alternatives. Current runners:
--debug
--verbose
--log-level N
Once we agree on a name I can cut a 0.7.2
release right away
@f-f Makes sense!
Also, I think --verbose
is more fitting than --debug
. @JamieBallingall has a point about that flag being used more frequently in CLI programs.
@f-f I'm ok with all three variants.
Renamed the flag to --verbose
, I'll cut a release
@starper: https://github.com/spacchetti/spago/releases/tag/0.7.2.0
It will be available on npm as soon as CI is done building the binaries
I think it would be better to add something like
--debug
flag for it.Because some messages can be really big. Like, for example, this one:
And, with the latest
spago
, this message is now printed every timebuild
command is called.