← Back to team overview

mahara-contributors team mailing list archive

[Bug 1275617] Re: Allow CLI api to specify exit code

 

** Changed in: mahara
       Status: In Progress => Fix Committed

-- 
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:
  Fix Committed

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