Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use bigger titles for FAQ to make it more prominent

  • Loading branch information...
commit 26af32fd7f2e0f9d9e2d8768d44278a756313cb4 1 parent 2108255
@florianpilz authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 README.md
View
14 README.md
@@ -93,18 +93,22 @@ However, improvements must be one of the following:
* enhance readablity or functionality, without increasing the lines of code
Frequently Asked Questions
---------------------------
+==========================
-### All my argument values are either true or false - what's wrong?
+All my argument values are either true or false - what's wrong?
+---------------------------------------------------------------
You must define default values, if the option should accept an argument. Every option without a default value (or with `true` or `false` as default) is treated as a switch: true if given and false / default otherwise.
-### Is it possible to define mandatory / required arguments, which must be provided?
+Is it possible to define mandatory / required arguments, which must be provided?
+--------------------------------------------------------------------------------
No it's not. It should be possible in any case to provide a reasonable default value. If you come across a case where it's not possible, feel free to contact me.
-### Are long arguments with spaces and other special characters allowed?
+Are long arguments with spaces and other special characters allowed?
+--------------------------------------------------------------------
Yes, just define an option which takes a `String` as an argument, i.e. pass a string as the default value for that option. Now everything between quotes will be parsed as the value for that argument, e.g. `ruby testscript.rb --selection 'I want the best selection you have!!! And if possible, add Donuts.'` Note that double quotes may cause trouble, for example I get an error if I use an exclamation mark in double quotes, but no error in single quotes.
-### Is it possible to define arguments which accept lists / arrays / multiple files / ... ?
+Is it possible to define arguments which accept lists / arrays / multiple files / ... ?
+---------------------------------------------------------------------------------------
Yes, just define an option which takes an `Array` as an argument, i.e. pass an array as the default value for that option. The input will be split by comma. If the arguments contain spaces, wrap the whole thing in single quotes or double quotes.
For example if you want to accept multiple file names with whitespaces in them:
Please sign in to comment.
Something went wrong with that request. Please try again.