sluyspy.cli module

Command-line interface functions for the sluyspy package

sluyspy.cli.dialog(text)[source]

Present a dialog text and wait for a single-key answer.

Parameters:

text (str) – The text to print.

Returns:

The single character typed by the user.

Return type:

(str)

sluyspy.cli.error(message, exit_program=True, exit_code=1)[source]

Print a coloured error message to stderr and exit.

Parameters:
  • message (str) – Message to print.

  • exit_program (bool) – Exit the program or not, defaults to True.

  • exit_code (int) – Exit code to exit the program with, defaults to 1.

sluyspy.cli.warn(message, exit_program=False, exit_code=1)[source]

Print a coloured warn message to stderr and exit.

Parameters:
  • message (str) – Message to print.

  • exit_program (bool) – Exit the program or not, defaults to False.

  • exit_code (int) – Exit code to exit the program with, defaults to 1.