hpasteit 0.2.1.0 → 0.2.2.0
raw patch · 2 files changed
+14/−12 lines, 2 filesdep +safedep ~base
Dependencies added: safe
Dependency ranges changed: base
Files
- ProgOpts.hs +9/−8
- hpasteit.cabal +5/−4
ProgOpts.hs view
@@ -7,10 +7,10 @@ import Data.Char import Data.List import Data.Monoid-import Text.Read import Network.URI import Options.Applicative+import Safe data ProgOpts = PasteOpts { optTitle :: String , optAuthor :: String@@ -21,10 +21,10 @@ | ViewOpts { optPasteID :: Integer } optParser :: Parser ProgOpts-optParser- = subparser $ mconcat [ command "paste" (info optPasteParser infoMod)- , command "view" (info optViewParser infoMod)- ]+optParser = subparser $ mconcat+ [ command "paste" (info optPasteParser (infoMod <> progDesc "paste something"))+ , command "view" (info optViewParser (infoMod <> progDesc "view a paste"))+ ] optViewParser :: Parser ProgOpts optViewParser = ViewOpts@@ -35,7 +35,7 @@ pasteIDHelp = "The URL or the ID number of the paste you want to view" parsePasteID :: String -> Maybe Integer- parsePasteID input = readMaybe input <|> parsePasteUri input+ parsePasteID input = readMay input <|> parsePasteUri input parsePasteUri :: String -> Maybe Integer parsePasteUri input = do@@ -44,7 +44,7 @@ URIAuth { uriRegName = "hpaste.org" } <- uri_authority - paste_id <- readMaybe uri_path+ paste_id <- readMay uri_path guard (paste_id > 0) return paste_id where@@ -137,5 +137,6 @@ parseOpts = customExecParser (prefs showHelpOnError) $ info (helper <*> optParser) $ mconcat [ infoMod- , footer "Append --help after a command to see detailed usage information"+ , footer $ "Append --help after a command to see detailed "+ ++ "usage information" ]
hpasteit.cabal view
@@ -1,5 +1,5 @@ name: hpasteit-version: 0.2.1.0+version: 0.2.2.0 synopsis: A command-line client for hpaste.org license: BSD3 license-file: LICENSE@@ -16,8 +16,8 @@ description: HPasteIt is a command-line client for hpaste.org .- Run @hpasteit --help@ for usage information and @hpasteit COMMAND --help@ for detailed- usage information for a particular command.+ Run @hpasteit --help@ for usage information and @hpasteit COMMAND --help@ for+ detailed usage information about a particular command. source-repository head type: git@@ -27,7 +27,7 @@ main-is: HPasteIt.hs other-modules: ProgOpts - build-depends: base ==4.6.*+ build-depends: base <5.0 , bytestring ==0.10.* , lifted-base ==0.2.* , http-conduit ==1.8.*@@ -36,6 +36,7 @@ , process ==1.1.* , network ==2.4.* , directory ==1.2.*+ , safe ==0.3.* ghc-options: -Wall