mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #17020
[Bug 1275617] A change has been merged
Reviewed: https://reviews.mahara.org/2979
Committed: http://gitorious.org/mahara/mahara/commit/8725ae5da3927a2addaade20ea620d4a51a71b1a
Submitter: Son Nguyen (son.nguyen@xxxxxxxxxxxxxxx)
Branch: master
commit 8725ae5da3927a2addaade20ea620d4a51a71b1a
Author: Aaron Wells <aaronw@xxxxxxxxxxxxxxx>
Date: Mon Feb 3 17:56:30 2014 +1300
Allow CLI api to directly specify Unix process return code
Bug1275617. Existing code only accept a boolean value for the $error
parameter, and return 0 or 127 for success or failure. This patch
allows you to pass an int for the $error parameter, in which case
that int is used as the return code. If you pass a boolean, we use
the old 0/127 behavior.
Change-Id: I96637f9c896184dc36c51bb968284f47f4fbc864
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1275617
Title:
Allow CLI api to specify exit code
Status in Mahara ePortfolio:
In Progress
Bug description:
I just noticed a bug in the (rarely used) command-line API for Mahara.
The function cli->cli_print_help() is supposed to allow you to include
an exit code, i.e. an integer to pass as the Unix exit value for the
process. However, the way cli->cli_exit() is written, you can't
actually specify a raw exit code. Instead, only booleans are accepted.
I've written a small fix to cli_exit() to make it so that if the param
is an int, we pass that raw int as the exit code, and if the param is
a boolean, we use that to determine whether to pass 0 (success) or 127
(failure).
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1275617/+subscriptions
References