file-command-qq-0.1.0.2: file-command-qq.cabal
-- Initial file-command-qq.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: file-command-qq
version: 0.1.0.2
synopsis: Quasiquoter for system commands involving filepaths
description:
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>
homepage: https://github.com/jfischoff/file-command-qq
license: MIT
license-file: LICENSE
author: Jonathan Fischoff
maintainer: jonathangfischoff@gmail.com
-- copyright:
category: System
build-type: Simple
extra-source-files: README.md
cabal-version: >=1.10
library
exposed-modules: FileCommand
-- other-modules:
other-extensions: TemplateHaskell, QuasiQuotes, LambdaCase
build-depends: base >=4.7 && <4.8, parsec >=3.1 && <3.2, template-haskell >=2.9 && <2.10, process >=1.2 && <1.3, system-filepath >=0.4 && <0.5, text >=1.1 && <1.2
hs-source-dirs: src
default-language: Haskell2010