Settings

When using pnyx.cmd, settings can be adjusted directly as parse of your commands, or by overriding the default settings. Both options can be used at the same time, in which case, settings changed via commands take priority.

Setting via Command

To change the settings using a command, call the setSettings method. Any number of settings can be modified with a single command. The following example changes the temp directory and default encoding:
pnyx -i "[{setSettings: {tempDirectory: '/mytmp', defaultEncoding: utf-8}},
{read: myfile.txt},{sortLine: }]"

Settings File

pnyx.cmd has a built in flag (-vs or --verboseSettings) to display the default settings, and to help locate where to place a settings file. pnyx.cmd checks in both the lib directory and the base directory for a file named pnyx_settings.yaml. When the project is initially installed, a sample file is save in the preferred location. It has all of the current settings commented out, so that modifying a setting is as easy as removing the comment.

To verify both the location of the settings file and the current settings for pnyx.cmd, run with the verboseSettings flag. For example:
user@Dmachine:$ pnyx --verboseSettings
- Starting search for 'pnyx_settings.yaml' file
- Directory of application: /opt/pnyx/lib/
- Checking parent directory: /opt/pnyx
- Found settings file: /opt/pnyx/pnyx_settings.yaml
- Settings file '/opt/pnyx/pnyx_settings.yaml' contained no settings and was ignored

Showing default settings of application:

tempDirectory: /mytmp
bufferLines: 10000
defaultEncoding: us-ascii
detectEncodingFromByteOrderMarks: true
outputByteOrderMarks: true
defaultNewline: >2+


backupRewrite: true
processOnDispose: true
csvDelimiter: ','
csvEscapeChar: '"'