ls-usb 0.1.0.8 → 0.1.0.9
raw patch · 4 files changed
+33/−21 lines, 4 filesdep +textdep −bytestringdep ~usbdep ~usb-safe
Dependencies added: text
Dependencies removed: bytestring
Dependency ranges changed: usb, usb-safe
Files
- LICENSE +1/−1
- PrettyDevList.hs +11/−8
- ls-usb.cabal +10/−9
- ls-usb.hs +11/−3
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2009–2010 Roel van Dijk+Copyright 2009–2011 Roel van Dijk All rights reserved.
PrettyDevList.hs view
@@ -5,6 +5,12 @@ , UnicodeSyntax #-} +{-|+Module : PrettyDevList+Copyright : 2009–2011 Roel van Dijk+License : BSD3 (see the file LICENSE)+Maintainer : Roel van Dijk <vandijk.roel@gmail.com>+-} module PrettyDevList ( PPStyle(..) , brightStyle, darkStyle@@ -52,8 +58,8 @@ import Data.Eq.Unicode ( (≡) ) import Prelude.Unicode ( (⋅) ) --- from bytestring:-import Data.ByteString.Char8 ( ByteString, unpack )+-- from text:+import qualified Data.Text as T ( Text, unpack ) -- from usb: import System.USB.Descriptors ( DeviceDesc@@ -106,7 +112,7 @@ -- from usb-safe: import System.USB.Safe ( withDevice , getStrDescFirstLang- , getLanguages + , getLanguages ) @@ -168,13 +174,10 @@ ------------------------------------------------------------------------------- -- Some basic instances of the Pretty class -instance Pretty ByteString where- pretty = pretty ∘ unpack+instance Pretty T.Text where+ pretty = pretty ∘ T.unpack instance Pretty Word8 where- pretty = int ∘ fromIntegral--instance Pretty Word16 where pretty = int ∘ fromIntegral -------------------------------------------------------------------------------
ls-usb.cabal view
@@ -1,31 +1,32 @@ name: ls-usb-version: 0.1.0.8+version: 0.1.0.9 cabal-version: >= 1.6 build-type: Simple stability: beta author: Roel van Dijk <vandijk.roel@gmail.com>-maintainer: vandijk.roel@gmail.com-copyright: 2009–2010 Roel van Dijk <vandijk.roel@gmail.com>+maintainer: Roel van Dijk <vandijk.roel@gmail.com>+copyright: 2009–2011 Roel van Dijk <vandijk.roel@gmail.com> license: BSD3 license-file: LICENSE category: System synopsis: List USB devices description:- A small utility that lists USB devices connected to your system.+ A small utility for displaying information about USB devices+ connected to your system. source-repository head- type: darcs- location: http://code.haskell.org/~roelvandijk/code/ls-usb+ type: git+ location: git://github.com/roelvandijk/ls-usb.git executable ls-usb build-depends: ansi-wl-pprint >= 0.5.1 && < 0.7 , base >= 4.0 && < 4.4 , base-unicode-symbols >= 0.1.1 && < 0.3- , bytestring >= 0.9.1 && < 0.10+ , text >= 0.1 && < 0.12 , cmdargs >= 0.3 && < 0.7- , usb >= 0.6 && < 0.8+ , usb >= 0.8 && < 0.9 , usb-id-database >= 0.4.0.2 && < 0.5- , usb-safe >= 0.10 && < 0.12+ , usb-safe >= 0.12 && < 0.13 ghc-options: -Wall -fno-warn-orphans main-is: ls-usb.hs other-modules: PrettyDevList
ls-usb.hs view
@@ -1,5 +1,11 @@ {-# LANGUAGE CPP, DeriveDataTypeable, NoImplicitPrelude, UnicodeSyntax #-} +{-|+Module : Main+Copyright : 2009–2011 Roel van Dijk+License : BSD3 (see the file LICENSE)+Maintainer : Roel van Dijk <vandijk.roel@gmail.com>+-} module Main where -- from ansi-wl-pprint:@@ -11,9 +17,10 @@ import Data.Data ( Data ) import Data.Function ( ($), const, id ) import Data.Int ( Int )-import Data.List ( filter, foldr, map )+import Data.List ( (++), filter, foldr, map ) import Data.Typeable ( Typeable ) import Data.Word ( Word8 )+import Data.Version ( showVersion ) import Prelude ( fromIntegral ) import System.IO ( IO, putStrLn ) import Text.Show ( Show )@@ -37,10 +44,11 @@ import PrettyDevList ( ppDevices , brightStyle, darkStyle )+import Paths_ls_usb ( version ) -- from usb: import System.USB.Initialization ( Verbosity(PrintNothing)- , newCtx, setDebug + , newCtx, setDebug ) import System.USB.Enumeration ( Device , getDevices, deviceDesc@@ -81,7 +89,7 @@ &= help "Use darker colours (for bright backgrounds)" } &= verbosity &= help "Lists connected USB devices"- &= summary "ls-usb 0.1.0.5, (C) Roel van Dijk 2009-2010"+ &= summary ("ls-usb " ++ showVersion version ++ ", (C) Roel van Dijk 2009-2010") &= details ["Please ensure you have sufficient rights before running with higher verbosity"] main ∷ IO ()