Skip to content

A puppet function to convert a hash to command line arguments

Notifications You must be signed in to change notification settings

pcfens/puppet-command_args

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

puppet-command_args

Build Status

Convert a hash into command line arguments. The first argument is a hash of arguments that should be passed, along with corresponding value.

Optional (positional) arguments:

  1. The flag prefix to use (defaults to '--')
  2. The separator to use (defaults to '=')

Example:

$arguments = {
  'aString'   => 'words',
  'secure'    => true,
  'insecure'  => false,
  'array'     => ['item1', 'item2'],
}

command_args($arguments)
# => --aString=words --secure --array=item1 --array=item2

command_args($arguments, '-')
# => -aString=words -secure -array=item1 -array=item2

command_args($arguments, '--', ' ')
# => --aString words --secure --array item1 --array item2

About

A puppet function to convert a hash to command line arguments

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages