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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
0603ffb7
Verified
Commit
0603ffb7
authored
Apr 30, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[cli] list routes sorted by path
parent
71f84c4c
Pipeline
#7554
passed with stages
in 55 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Routes.hs
bin/gargantext-cli/CLI/Server/Routes.hs
+8
-2
No files found.
bin/gargantext-cli/CLI/Server/Routes.hs
View file @
0603ffb7
...
@@ -13,11 +13,13 @@ import CLI.Types
...
@@ -13,11 +13,13 @@ import CLI.Types
import
Data.Aeson.Encode.Pretty
import
Data.Aeson.Encode.Pretty
import
Data.ByteString
qualified
as
B
import
Data.ByteString
qualified
as
B
import
Data.ByteString.Lazy
qualified
as
BL
import
Data.ByteString.Lazy
qualified
as
BL
import
Data.Text.IO
qualified
as
T
import
Gargantext.API.Routes.Named
import
Gargantext.API.Routes.Named
import
Gargantext.Prelude
import
Options.Applicative
import
Options.Applicative
import
Prelude
import
Servant.API
import
Servant.API
import
Servant.API.Routes
import
Servant.API.Routes
import
Servant.API.Routes.Internal.Route
(
routePath
)
import
Servant.API.WebSocket
qualified
as
WS
(
WebSocketPending
)
import
Servant.API.WebSocket
qualified
as
WS
(
WebSocketPending
)
import
Servant.Auth
qualified
as
Servant
import
Servant.Auth
qualified
as
Servant
...
@@ -52,6 +54,10 @@ instance HasRoutes Raw where
...
@@ -52,6 +54,10 @@ instance HasRoutes Raw where
routesCLI
::
CLIRoutes
->
IO
()
routesCLI
::
CLIRoutes
->
IO
()
routesCLI
=
\
case
routesCLI
=
\
case
CLIR_list
CLIR_list
->
printRoutes
@
(
NamedRoutes
API
)
->
do
let
routes
=
getRoutes
@
(
NamedRoutes
API
)
let
cmpFunc
r
=
renderPath
(
r
^.
routePath
)
let
sortedRoutes
=
sortBy
(
\
a
b
->
compare
(
cmpFunc
a
)
(
cmpFunc
b
))
routes
traverse_
(
T
.
putStrLn
.
renderRoute
)
sortedRoutes
(
CLIR_export
filePath
)
(
CLIR_export
filePath
)
->
B
.
writeFile
filePath
.
BL
.
toStrict
$
encodePretty
(
getRoutes
@
(
NamedRoutes
API
))
->
B
.
writeFile
filePath
.
BL
.
toStrict
$
encodePretty
(
getRoutes
@
(
NamedRoutes
API
))
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