Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pcfens/puppet-command_args
A puppet function to convert a hash to command line arguments
https://github.com/pcfens/puppet-command_args
Last synced: about 2 months ago
JSON representation
A puppet function to convert a hash to command line arguments
- Host: GitHub
- URL: https://github.com/pcfens/puppet-command_args
- Owner: pcfens
- Created: 2015-10-20T15:35:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-21T21:05:09.000Z (almost 9 years ago)
- Last Synced: 2024-11-21T19:08:58.337Z (2 months ago)
- Language: Ruby
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
puppet-command_args
===================[![Build Status](https://travis-ci.org/pcfens/puppet-command_args.svg?branch=master)](https://travis-ci.org/pcfens/puppet-command_args)
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=item2command_args($arguments, '-')
# => -aString=words -secure -array=item1 -array=item2command_args($arguments, '--', ' ')
# => --aString words --secure --array item1 --array item2
```