12 import System
.Environment
14 dbName
= progName
++ ".db"
17 tableName
= progName
++ "Table"
30 isHelp
:: String -> Bool
31 isHelp str
= str `
elem`
["-h","help","--help"]
33 usage
:: Operation
-> String
34 usage op
= show op
++ " not yet implemented"
36 parseArg
:: String -> Either String Operation
37 parseArg op
= case op
of
39 "bookmark" -> Right Bookmark
40 "citation" -> Right Citation
43 "--help" -> Right Help
44 "modify" -> Right Modify
45 "remove" -> Right Remove
46 "search" -> Right Search
48 "version" -> Right Version
49 _
-> Left
$ "Invalid argument: " ++ op