.. _popy_check:

|popy_check|
############

When developing a |popy| script file it is sometimes useful to sanity check the input and automatically detect common errors. 

Note this checking process also happens when using :ref:`popy_run`, however the :ref:`popy_check` enables you to check before you are ready to run a script.

.. _popy_check_single_script:

Checking a script
==================

Check a script by opening a :ref:`open_a_popy_command_prompt` and typing:-

.. code-block:: console

    $ popy check my_script.pyml
 
Note a common switch to use with :ref:`popy_check`  is:-

.. code-block:: console

    $ popy check -o my_script.pyml

Here the '-o' option overwrites previous output automatically. If the script has already been run and you do not use the '-o' option, you will be asked to confirm you want to overwrite any previous output.

For other command line options see :ref:`popy_check_command_line_options`.

.. _popy_check_multi_scripts:

Checking multiple scripts
===========================

Note you can also check all scripts in a directory using:-

.. code-block:: console

    popy check *.pyml

This checks all files with the '.pyml' extension in serial.

.. _popy_check_log_files:
  
Log files created by popy_check 
=================================
 
When :ref:`popy_check` processes a script file, it creates a log file, ``my_script.pyml.check.log`` that should
enable you to more easily edit and fix a broken script file.

.. _popy_check_command_line_options:

Command line options
======================

.. literalinclude:: /_autogen/tool_help/popy_check_help.inc
    :language: console 
