Il giorno 23/ago/08, alle ore 14:12, Krzysztof A. Adamski ha scritto:
How do you see a "global" switch to choose between human- and
machine- readable outputs? The commandline interface could default
to human and the API to machine. Something like:
func -m $host call $mymodules blah ---> machine-readable output
func -h $host call... ---> human-readable
output func $host call.... ---> human-readable
output
I like the general idea but it is not going to work the way you
proposed. First of all, you are giving "-h" or "-m" argument to
func command line utility while it would be much easier to just
implement this in "call" cmd_module.
The actual data is returned by the module so you have to tell the
module in which way it should be returned.
Mine was just an example. Depends on where and how you want to put
the formatting code.
This can be done in various ways but it's important to think about
good one and use it in all modules.
the way I see it, it's a piece of information that relates to the
global func behavior, since the func caller would either want all
human-readable stuff or all machine-ready stuff. I'd implement it as
a func (meaning the actual command) switch (it could also affect
locally generated output like errors and whatever), and the the
client would inform the remote funcd daemon about its output
preferences.
Patches are welcome.
I was sure of that :)
--
Luca Lesinigo
_______________________________________________
Func-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/func-list