file-command-qq: Quasiquoter for system commands involving filepaths
file-command-qq is a simple quasiquoter for running system commands that take a filepath as an argument.
For instance
>>>
:set -XOverloadedStrings
>>>
import FileCommand
>>>
import Filesystem.Path
>>>
[s|echo $filename|] "/home/test/thing.txt"
will return
thing.txt ExitSuccess
You can think of [s|echo $filename|]
essentially converts into
\path -> system $ "echo" ++ encodeString (filename path)
Here is another example
>>>
[s|gcc $path -o $directory$basename.o|] "/home/test/thing.c"
All "file parts" start with a '$'. The '$' can be escaped by preceding it with a '\'
There are the following options for "file parts"
$path
$root
$directory
$parent
$filename
$dirname
$basename
$ext
Which correspond to the respective functions in https://hackage.haskell.org/package/system-filepath-0.4.6/docs/Filesystem-Path.html#g:1
[Skip to Readme]
Downloads
- file-command-qq-0.1.0.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5 |
---|---|
Dependencies | base (>=4.7 && <4.8), parsec (>=3.1 && <3.2), process (>=1.2 && <1.3), system-filepath (>=0.4 && <0.5), template-haskell (>=2.9 && <2.10), text (>=1.1 && <1.2) [details] |
License | MIT |
Author | Jonathan Fischoff |
Maintainer | jonathangfischoff@gmail.com |
Category | System |
Home page | https://github.com/jfischoff/file-command-qq |
Uploaded | by JonathanFischoff at 2014-11-10T06:11:53Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 4359 total (22 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user Build status unknown [no reports yet] |