CLI API does not use stderr

The nodeworx CLI outputs errors to stdout. Shouldn’t it echo them to stderr instead?

For example, running this erroneous command…

# nodeworx -u -n -c Apikey -a listApike

…results in:

action : "listApike" This is not a valid option

Usage: nodeworx.php Apikey listApike [ options ]
--help|-h                Display this help and exit
--session-id <string>    Session ID for continuing a session
--user-auth|-u           Authenticate by unixuser
--interactive|-i         Render in interactive mode with a session
--non-interactive|-n     Render in non-interactive mode for programming
--verbose|-v             Outputs more verbose information in non-interactive mode
--controller|-c <string> Index|Overview|Users|Lang|Themes|Apikey|Siteworx|Shell|Packages|Backup|Import|Simplescripts|Reseller|ResellerPackages|ResellerBandwidthhistory|Http|MailMta|MailSmtp|MailSmtp2|MailSend|MailMda|MailPop3|MailSpop3|MailImap|MailSimap|MailSpam|MailVirus|MailQueue|Ftp|Mysql|MysqlPhpmyadmin|Dns|DnsZone|DnsRecord|DnsSync|Sshd|Nfs|NfsExport|NfsMount|Health|Cron|Ip|Firewall|Ssl|Logs|Settings|Updates|Rrd|Cluster|Plugins
--action|-a <string>     listApikey|index|delete|generate|isARecorded

The output went to stdout. Additionally, that’s not exactly non-interactive output, complete with dynamic suggestions (neat feature, btw) that scripts would not expect. :wink:

The command typed correctly yields my API key, of course. I am reporting this because I believe the absence of an API key would be reported to stdout, not stderr, and confuse a script that is expecting “key or nothing” instead of error information.

Two things:


  • Errors should go to stderr, not stdout.
  • No "Usage" information for non-interactive mode, please. [/LIST]
  • Hi Jimp,
    These are very good suggestions, and I am adding them to the bug tracker for developer review.