Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
gargantext
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
...
@@ -9,10 +9,14 @@ Portability : POSIX
-}
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
module
Main
where
module
Main
where
...
@@ -23,27 +27,27 @@ import Data.Text (unpack)
...
@@ -23,27 +27,27 @@ import Data.Text (unpack)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.API
(
startGargantext
,
startGargantextMock
)
import
Gargantext.API
(
startGargantext
,
startGargantextMock
)
--------------------------------------------------------
------------------------------------------------------
data
Mode
=
Dev
|
Mock
|
Prod
data
Mode
=
Dev
|
Mock
|
Prod
deriving
(
Show
,
Read
,
Generic
)
deriving
(
Show
,
Read
,
Generic
)
instance
ParseRecord
Mode
instance
ParseRecord
Mode
instance
ParseField
Mode
instance
ParseField
Mode
instance
ParseFields
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
::
IO
()
main
=
do
main
=
do
MyOptions
myMode
myPort
myIniFile
<-
getRecord
MyOptions
myMode
myPort
myIniFile
<-
unwrapRecord
"Gargantext: collaborative platform for text-mining"
"Gargantext: collaborative platform for text-mining"
let
myPort'
=
case
myPort
of
let
myPort'
=
case
myPort
of
...
@@ -58,7 +62,7 @@ main = do
...
@@ -58,7 +62,7 @@ main = do
Nothing
->
panic
"Need gargantext.ini file"
Nothing
->
panic
"Need gargantext.ini file"
Just
i
->
i
Just
i
->
i
Mock
->
startGargantextMock
myPort'
Mock
->
startGargantextMock
myPort'
Dev
->
startGargantextMock
myPort'
_
->
startGargantextMock
myPort'
putStrLn
$
"Starting Gargantext with mode: "
<>
show
myMode
putStrLn
$
"Starting Gargantext with mode: "
<>
show
myMode
start
start
package.yaml
View file @
940cb0e2
...
@@ -126,11 +126,11 @@ executable:
...
@@ -126,11 +126,11 @@ executable:
source-dirs
:
app
source-dirs
:
app
ghc-options
:
-threaded -rtsopts -with-rtsopts=-N -O2
ghc-options
:
-threaded -rtsopts -with-rtsopts=-N -O2
dependencies
:
dependencies
:
-
base
-
gargantext
-
gargantext
-
ini
-
ini
-
base
-
unordered-containers
-
optparse-generic
-
optparse-generic
-
unordered-containers
tests
:
tests
:
garg-test
:
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