Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
940cb0e2
Commit
940cb0e2
authored
Mar 05, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BIN] Command line options with help: ~/.local/bin/gargantext --help
parent
761dcb39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
Main.hs
app/Main.hs
+17
-13
package.yaml
package.yaml
+2
-2
No files found.
app/Main.hs
View file @
940cb0e2
...
...
@@ -9,10 +9,14 @@ Portability : POSIX
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
module
Main
where
...
...
@@ -23,27 +27,27 @@ import Data.Text (unpack)
import
Gargantext.Prelude
import
Gargantext.API
(
startGargantext
,
startGargantextMock
)
------------------------------------------------------
--------------------------------------------------------
data
Mode
=
Dev
|
Mock
|
Prod
deriving
(
Show
,
Read
,
Generic
)
deriving
(
Show
,
Read
,
Generic
)
instance
ParseRecord
Mode
instance
ParseField
Mode
instance
ParseFields
Mode
data
MyOptions
=
MyOptions
{
run
::
Mode
,
port
::
Maybe
Int
,
iniFile
::
Maybe
Text
}
deriving
(
Generic
,
Show
)
instance
ParseRecord
MyOptions
data
MyOptions
w
=
MyOptions
{
run
::
w
:::
Mode
<?>
"Possible modes: Dev | Mock | Prod"
,
port
::
w
:::
Maybe
Int
<?>
"By default: 8008"
,
iniFile
::
w
:::
Maybe
Text
<?>
"Example file: gargantext.ini"
}
deriving
(
Generic
)
instance
ParseRecord
(
MyOptions
Wrapped
)
deriving
instance
Show
(
MyOptions
Unwrapped
)
main
::
IO
()
main
=
do
MyOptions
myMode
myPort
myIniFile
<-
getRecord
MyOptions
myMode
myPort
myIniFile
<-
unwrapRecord
"Gargantext: collaborative platform for text-mining"
let
myPort'
=
case
myPort
of
...
...
@@ -58,7 +62,7 @@ main = do
Nothing
->
panic
"Need gargantext.ini file"
Just
i
->
i
Mock
->
startGargantextMock
myPort'
Dev
->
startGargantextMock
myPort'
_
->
startGargantextMock
myPort'
putStrLn
$
"Starting Gargantext with mode: "
<>
show
myMode
start
package.yaml
View file @
940cb0e2
...
...
@@ -126,11 +126,11 @@ executable:
source-dirs
:
app
ghc-options
:
-threaded -rtsopts -with-rtsopts=-N -O2
dependencies
:
-
base
-
gargantext
-
ini
-
base
-
unordered-containers
-
optparse-generic
-
unordered-containers
tests
:
garg-test
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment