shellmet: Out of the shell solution for scripting in Haskell

[ command-line, library, mpl, shell ] [ Propose Tags ] [ Report a vulnerability ]

Shellmet provides easy and convenient way to call shell commands from Haskell programs


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0, 0.0.1, 0.0.2.0, 0.0.3.0, 0.0.3.1, 0.0.4.0, 0.0.4.1, 0.0.5.0
Change log CHANGELOG.md
Dependencies base (>=4.11.1.0 && <4.21), process (>=1.6.1 && <1.7), shellmet, text (>=1.2.3 && <2.2) [details]
Tested with ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.2, ghc ==9.2.8, ghc ==9.4.7, ghc ==9.6.6, ghc ==9.8.2, ghc ==9.10.1
License MPL-2.0
Copyright 2019-2022 Kowainik
Author Dmitrii Kovanikov
Maintainer Kowainik <xrom.xkov@gmail.com>
Category Shell, Command Line
Home page https://github.com/kowainik/shellmet
Bug tracker https://github.com/kowainik/shellmet/issues
Source repo head: git clone https://github.com/kowainik/shellmet.git
Uploaded by vrom911 at 2024-10-20T14:10:11Z
Distributions Arch:0.0.5.0, LTSHaskell:0.0.5.0, NixOS:0.0.5.0, Stackage:0.0.5.0
Reverse Dependencies 4 direct, 1 indirect [details]
Executables readme
Downloads 4053 total (44 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]

Readme for shellmet-0.0.5.0

[back to package description]

shellmet

GitHub CI Hackage Stackage Lts Stackage Nightly MPL-2.0 license

Out of the shell solution for scripting in Haskell. Shellmet provides an easy and convenient way to call shell commands from Haskell programs.

Usage example

This README contains the usage example of the shellmet library. The example is runnable. You can build and execute with the following command:

cabal run readme

Setting up

Since this tutorial is written using Literate Haskell, first, let's write all necessary pragmas and imports.

{-# LANGUAGE OverloadedStrings #-}

import Data.Semigroup ((<>))

import Shellmet (($|))

import qualified Data.Text as T

Simple scripting example

Below you can see how easy it is to interact with shell commands in Haskell:

main :: IO ()
main = do
    "echo" ["Starting shellmet readme..."]
    text <- "cat" $| ["README.md"]
    let cnt = T.pack $ show $ length $ T.lines text
    "echo" ["Number of lines in this README: " <> cnt]

And the output is:

⚙  echo 'Starting shellmet readme...'
Starting shellmet readme...
⚙  echo 'Number of lines in this README: 54'
Number of lines in this README: 54