NAME
Getopt::Pad::Config::Format::Yaml - The yaml config file format
SYNOPSIS
config => { format => 'yaml', paths => ['~/.tool.yaml'] },
Options:
log-level: debug
tag:
- a
- b
commands:
resize:
Options:
width: 800
DESCRIPTION
The config file format yaml (also yml), based on YAML::XS.
YAML::XS is not installed together with Getopt::Pad. A spec whose config block uses this format makes GetOptions die with the spec error config format 'yaml' requires the YAML::XS module when YAML::XS is missing, whether or not a config file exists.
true and false are accepted for flag and bool options; yes, no, on and off are read as strings and rejected. ~ and empty values are reported as no value given (for hash and objectlist options as a value of the wrong shape). An empty file, or one with only comments, is reported as not containing a mapping of group names. Tags such as !!perl/hash:Foo never create objects: a config file is data.
--create-default-config writes a YAML document that starts with ---.
See "CONFIG FILES" in Getopt::Pad for the layout of config files.
SEE ALSO
Getopt::Pad::Config::Format, Getopt::Pad::Config::Format::Json
AUTHOR
davenonymous <perl@davenonymous.com>
COPYRIGHT AND LICENSE
Copyright 2026 davenonymous
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.