<commit_before>clicraft-actions(5)
===================

Name
----

clicraft-actions - clicraft shell hooks a.k.a "action scripts"

Synopsis
--------

{CONFDIR}/action.d/'action'.sh, {EXECDIR}/action.d/'action'.sh

Description
-----------

linkman:Clicraft[1] provides a way to extend functionality through 'action scripts',
which are bash scripts that get called by clicraft in a modified environment.
To create an action script, simply set your +EDITOR+ variable and use
clicraft's edit action. For instance:

	EDITOR=nano clicraft edit foo

An action script created in this way will get executed when running
+clicraft foo ['args']+.

Alternately, you can accomplish the same thing by writing a script with
filename +foo.sh+ and placing it in +$CONFDIR/action.d+. See the
<<vars,Variables>> section for the value of +$CONFDIR+.

There are also action
scripts in +$EXECDIR/action.d+, but these are system action scripts and may be
overwritten when updating clicraft. They can be overridden by creating new
action files in the manner described above.

Action scripts get sourced from within clicraft using something similar to
+. 'action'.sh+. They therefore have access to all of clicraft's internal
<<vars,variables>> and <<funcs,functions>>, described below.

[[vars]]
Variables
---------

*$1, $2, $3, ... $9*::
	Clicraft's positional parameters are available, but are shifted once to
	the left. Thus, when an action script +foo.sh+ is invoked with
	+clicraft foo bar baz+, +$1+ is +"bar"+ and +$2+ is +"baz"+.

*ACTION*::
	The name of this action. For an action script +foo.sh+ invoked with
	+clicraft foo bar baz+, +$ACTION+ is +"foo"+.

*MULTIPLEXER, SERVER_DIR, SERVER_NAME, SERVER_JAR, SERVER_URL, SERVER_LOG*::
*SERVER_VERSION, SERVER_TYPE, START_COMMAND, STOP_CMD, DOWNLOAD_COMMAND*::
*TIMEOUT, CMD_LSTRIP*::
	Configuration options are stored in variables by the same name as the
	option. For a description of these options and their default values, see
	linkman:clicraft.conf[5].
+
In addition to these variables, any extra user-defined options in
linkman:clicraft.conf[5] will be set in the environment. Unlike these
variables, however, they are not guaranteed to be set and will not have a
default value, so care must be taken to ensure that no undesirable behavior
occurs if they are not set in clicraft.conf.

*CONFDIR*={CONFDIR}::
	The directory where clicraft stores its configuration files. This is where
	linkman:clicraft.conf[5] is located. User action scripts are located in
	this directory under +$CONFDIR/action.d+.

*EXECDIR*={EXECDIR}::
	The directory for scripts used internally by clicraft. System action
	scripts are located in this directory under +$EXECDIR/action.d+.
+<commit_msg>Document new options in clicraft-actions.5<commit_after>clicraft-actions(5)
===================

Name
----

clicraft-actions - clicraft shell hooks a.k.a "action scripts"

Synopsis
--------

{CONFDIR}/action.d/'action'.sh, {EXECDIR}/action.d/'action'.sh

Description
-----------

linkman:Clicraft[1] provides a way to extend functionality through 'action scripts',
which are bash scripts that get called by clicraft in a modified environment.
To create an action script, simply set your +EDITOR+ variable and use
clicraft's edit action. For instance:

	EDITOR=nano clicraft edit foo

An action script created in this way will get executed when running
+clicraft foo ['args']+.

Alternately, you can accomplish the same thing by writing a script with
filename +foo.sh+ and placing it in +$CONFDIR/action.d+. See the
<<vars,Variables>> section for the value of +$CONFDIR+.

There are also action
scripts in +$EXECDIR/action.d+, but these are system action scripts and may be
overwritten when updating clicraft. They can be overridden by creating new
action files in the manner described above.

Action scripts get sourced from within clicraft using something similar to
+. 'action'.sh+. They therefore have access to all of clicraft's internal
<<vars,variables>> and <<funcs,functions>>, described below.

[[vars]]
Variables
---------

*$1, $2, $3, ... $9*::
	Clicraft's positional parameters are available, but are shifted once to
	the left. Thus, when an action script +foo.sh+ is invoked with
	+clicraft foo bar baz+, +$1+ is +"bar"+ and +$2+ is +"baz"+.

*ACTION*::
	The name of this action. For an action script +foo.sh+ invoked with
	+clicraft foo bar baz+, +$ACTION+ is +"foo"+.

*MULTIPLEXER, SERVER_DIR, SERVER_NAME, SERVER_JAR, SERVER_URL, SERVER_LOG*::
*SERVER_VERSION, SERVER_TYPE, START_COMMAND, STOP_CMD, DOWNLOAD_COMMAND*::
*TIMEOUT, START_TIMEOUT, STOP_TIMEOUT, CMD_TIMEOUT, CMD_LSTRIP, REDB*::
	Configuration options are stored in variables by the same name as the
	option. For a description of these options and their default values, see
	linkman:clicraft.conf[5].
+
In addition to these variables, any extra user-defined options in
linkman:clicraft.conf[5] will be set in the environment. Unlike these
variables, however, they are not guaranteed to be set and will not have a
default value, so care must be taken to ensure that no undesirable behavior
occurs if they are not set in clicraft.conf.

*CONFDIR*={CONFDIR}::
	The directory where clicraft stores its configuration files. This is where
	linkman:clicraft.conf[5] is located. User action scripts are located in
	this directory under +$CONFDIR/action.d+.

*EXECDIR*={EXECDIR}::
	The directory for scripts used internally by clicraft. System action
	scripts are located in this directory under +$EXECDIR/action.d+.
+
{'fraction_non_alphanumeric': 0.10507180512634066, 'fraction_numerical': 0.004181057989456462, 'mean_word_length': 4.643076923076923, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6581717', 'n_tokens_mistral': 1666, 'n_tokens_neox': 1615, 'n_words': 716}