.. _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 :command:`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 :command:`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 :command:`popy_check` processes a script file, it creates a log file:-

.. code-block:: console

    my_script.pyml.check.log
 
Hopefully the various error and warning messages will 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 
