When to use $DEBUG and $VERBOSE

I

Intransition

Ok, so I have a bin script and like so many other's use some common
options such as --verbose and --debug. Generally I have been keeping
these flags in an options hash, specific to my app. But I wondering if
perhaps these may just as well use the global vars. Is that a good
practice, or are these globals specifically for something more
specialized for use by developers and should not be used by
applications?

If these globals are generally useful to applications, I note that a
$NOOP global for FileUtils methods seems useful.
 
F

Fabian Streitel

[Note: parts of this message were removed to make it a legal post.]

well, setting $VERBOSE will also tamper with the display of warnings
issued by ruby, so it depends if that is included in what you want to
achieve
with --verbose.

In general, you could probably tie --debug to $DEBUG since to me that's
a developer's switch.

--verbose on the other hand sounds to me like it's intended for end users,
so ruby warnings to them will probably only be confusing (e.g. the
insecure directory warning)

Greetz!
 
T

trans

well, setting $VERBOSE will also tamper with the display of warnings
issued by ruby, so it depends if that is included in what you want to
achieve
with --verbose.

In general, you could probably tie --debug to $DEBUG since to me that's
a developer's switch.

--verbose on the other hand sounds to me like it's intended for end users= ,
so ruby warnings to them will probably only be confusing (e.g. the
insecure directory warning)

Thanks. You're right. And that puts things into perspective for me.
Seems to me $VERBOSE would have been more aptly labeled $WARN --then
$VERBOSE would have been available for CLIs.

T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,167
Messages
2,570,913
Members
47,455
Latest member
Delilah Code

Latest Threads

Top