Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to commute the prison sentence of a convicted criminal #1200

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

master-spike
Copy link
Contributor

@master-spike master-spike commented Jun 20, 2024

@myk002
Copy link
Member

myk002 commented Jun 21, 2024

commute-sentence isn't quite as discoverable as I'd like it to be. Could we instead call it justice? The initial functionality here could be invoked as justice pardon, and the overall syntax would be:

justice <command> [<options>]

with just the one command (pardon) for now. it should at least take a -u, --unit option to allow specific unit ids to be specified, and if no id is specified then it defaults to the selected unit.

@master-spike master-spike force-pushed the commute_sentence branch 2 times, most recently from c6ff149 to d1081ea Compare June 21, 2024 22:23
=======

.. dfhack-tool::
:summary: Commands related to the justice system
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:summary: Commands related to the justice system
:summary: Commands related to the justice system.

This tool allows control over aspects of the justice system, such as the
ability to pardon criminals.

usage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
usage
Usage

::
justice pardon [--unit <id>]

Pardon the selected unit or the one specified by unit id if provided. Currently
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pardon the selected unit or the one specified by unit id if provided. Currently
Pardon the selected unit or the one specified by unit id (if provided). Currently

only applies to prison time and doesn't cancel beatings or hammerings.


options
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
options
Options

unit = df.unit.find(unit_id)
if not unit then qerror(("No unit with id %i"):format(unit_id)) end
end
if unit then pardon_unit(unit) end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if unit then pardon_unit(unit) end
pardon_unit(unit)

Comment on lines +38 to +40
end

qerror(("Unrecognised command: %s"):format(command))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
qerror(("Unrecognised command: %s"):format(command))
elseif not command then
qerror('missing command')
else
qerror(("Unrecognised command: %s"):format(command))
end

Copy link
Member

@myk002 myk002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add a line to the changelog under New tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command to commute the prison sentence of convicted criminals
2 participants