tracker issue : CF-4126709

select a category, or use search below
(searches all categories and all time range)
Title:

Add functionality to specify an exit code to be returned to the shell

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 03/09/2016

Components: CLI

Versions: 2016

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Alpha_v12 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win All

Vote Count: 1

From PR forum:

[quote]
SSIA, really. Scripts generally return an exit code. Even when erroring, CFML one seem to return a code of 0, which means "OK". An erroring script possibly *shouldn’t* return a 0 (this’d be like returning a 200 OK for an error on an HTTP request), but also our code should be able to set an exit code to the shell. Some sort of modification to `exit` would probably be the way to go here.

NB: maybe this is already in place, but it’s hard to tell without any docs!

[/quote]

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4126709

External Customer Info:
External Company: Straker Interactive
External Customer Name: Adam Cameron
External Customer Email: CAMERON.ADAM@GMAIL.COM
External Test Config:

Attachments:

Comments:

Adding BUG AUDIT TRAIL ********action: updated fieldName: Reason newValue: Blank oldValue: Fixed oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-11-04 05:08:33.0 action: updated fieldName: Date Closed newValue: 2015-11-03 21:08:33.0 oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-11-04 05:08:33.0 action: updated fieldName: Closed By newValue: hkallae oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-11-04 05:08:33.0 action: updated fieldName: Owner newValue: Blank oldValue: hkallae oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-11-04 05:08:33.0 action: updated fieldName: State newValue: Closed oldValue: Open oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-11-04 05:08:33.0 action: updated fieldName: Status newValue: Fixed oldValue: ToTest oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-11-04 05:08:33.0 action: updated fieldName: Changelist newValue: 296116 oldValue: Blank oprid: himar recordName: RQ_DEFECT timpestamp: 2015-10-26 04:50:37.0 action: updated fieldName: Reason newValue: Fixed oldValue: Blank oprid: himar recordName: RQ_DEFECT timpestamp: 2015-10-26 04:50:37.0 action: updated fieldName: Status newValue: ToTest oldValue: ToFix oprid: himar recordName: RQ_DEFECT timpestamp: 2015-10-26 04:50:37.0 action: updated fieldName: Owner newValue: hkallae oldValue: himar oprid: himar recordName: RQ_DEFECT timpestamp: 2015-10-26 04:50:37.0 action: updated fieldName: Fixed By newValue: himar oldValue: Blank oprid: himar recordName: RQ_DEFECT timpestamp: 2015-10-26 04:50:37.0 action: updated fieldName: Date Fixed newValue: 2015-10-25 21:50:37.0 oldValue: Blank oprid: himar recordName: RQ_DEFECT timpestamp: 2015-10-26 04:50:37.0 action: updated fieldName: Priority newValue: 2 oldValue: 0 oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2015-09-10 04:07:32.0 action: updated fieldName: Status newValue: ToFix oldValue: NeedsReview oprid: rukumar recordName: RQ_DEFECT timpestamp: 2015-08-18 14:39:37.0 action: updated fieldName: Owner newValue: himar oldValue: rukumar oprid: rukumar recordName: RQ_DEFECT timpestamp: 2015-08-18 14:39:37.0 action: updated fieldName: Reason newValue: Blank oldValue: Blank oprid: rukumar recordName: RQ_DEFECT timpestamp: 2015-08-18 14:39:37.0 action: added fieldName: Vote Type newValue: BETA oldValue: Blank oprid: prerelease recordName: AD_DEFECT_VOTE timpestamp: 2015-07-16 18:36:58.0 action: updated fieldName: Fix By Milestone newValue: Beta oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-07-16 08:11:23.0 action: updated fieldName: Owner newValue: rukumar oldValue: hkallae oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-07-16 08:11:23.0 action: updated fieldName: Fix By Product Milestone newValue: Beta oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-07-16 08:11:23.0 action: updated fieldName: Status newValue: NeedsReview oldValue: Unverified oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-07-16 08:11:23.0 action: updated fieldName: Reason newValue: Blank oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-07-16 08:11:23.0
Comment by CFwatson U.
3439 | March 09, 2016 04:43:57 AM GMT
This is critical functionality if CFML is intended to be used for command line scripting.
Vote by External U.
3441 | March 09, 2016 04:43:58 AM GMT
Added By: PreRelease User User Name:Sean Corfield Note Added: Nice to see CF-4021637 addressed in the 9/15 build. I tested that calling java.lang.System.exit(142) does return 142 as the shell script status, but it also outputs an ugly Thread Error message. Have you decided how this feature will be provided? cli.exit(status) perhaps? Date Added :2015-09-15 21:56:45.0 Added By: PreRelease User User Name:Adam Cameron Note Added: Entered Feature. Date Added :2015-07-16 07:05:03.0
Comment by CFwatson U.
3440 | March 09, 2016 04:43:59 AM GMT