turtle-options: Collection of command line options and parsers for these options

[ bsd3, library, program, utils ] [ Propose Tags ]

Please see README.md

[Skip to Readme]
Versions [RSS] [faq],,,,
Dependencies base (>=4.7 && <5), optional-args, parsec, text, turtle, turtle-options [details]
License BSD-3-Clause
Copyright 2016 Elie Genard
Author Elie Genard
Maintainer elaye@users.noreply.github.com
Category Utils
Home page https://github.com/elaye/turtle-options#readme
Source repo head: git clone https://github.com/elaye/turtle-options
Uploaded by elaye at 2016-03-03T17:35:47Z
Distributions NixOS:
Executables example
Downloads 2897 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2016-03-03 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees


Readme for turtle-options-

[back to package description]

Turtle options

Build Status

This package provides additional command line options for Turtle.


Parse a percentage (20%). The result is a floating point number (Float), corresponding to the given percentage divided by 100.


Parse a scaling option in different ways. You can specify a size (480x320), a width (480x) or a height (x320) or a percentage (50% or 0.5, needs to be positive).


Parse a quality option. This can be a percentage or a keyword (verylow, low, mediumlow, medium, mediumhigh, high, best). The keywords are mapped to a percentage according to the following table:

Keyword Percentage
verylow 10%
low 20%
mediumlow 35%
medium 50%
mediumhigh 65%
high 80%
veryhigh 90%
best 100%


Parse a timecode. A timecode is made of a number of hours, minutes, seconds and milliseconds. The time code can be given in different formats. You don't have to give a number of seconds or minutes inferior to 60. For example if you give 75 minutes, it will be interpreted as 1 hour and 15 minutes. You can also provide a number of milliseconds superior to 1000. The only required number is the number of seconds. The following table gives examples of valid timecodes and how they are interpreted:

Timecode Result
3 3 secs
75 1 min 15 secs
17:12 17 mins 12 secs
80:23 1 hour 20 mins 23 secs
54:32:10 54 hours 32 mins 10 secs
43.7 43 secs 700 millisecs
4:13.85 4 mins 13 secs 850 millisecs
7:4:13.437 7 hours 4 mins 13 secs 437 millisecs
5.2150 7 secs 150 milliseconds

You can also use the 00h00m00s000 format if you prefer. The same rules apply:

1h34m12s345 gives 1 hour 34 mins 12 secs and 345 millisecs

A timecode can be negative:

-3:45 (or -3m45) gives minus 3 mins and 45 secs