mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #16791
[Bug 1275617] [NEW] Allow CLI api to specify exit code
Public bug reported:
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).
** Affects: mahara
Importance: Low
Assignee: Aaron Wells (u-aaronw)
Status: In Progress
** Tags: api cli
--
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
Follow ups
References