Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
argotest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Reis
argotest
Commits
9941d842
Commit
9941d842
authored
Dec 13, 2018
by
Valentin Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the "arbitrary command" action and documented the available
actions more.
parent
14188de1
Pipeline
#4643
passed with stage
in 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
11 deletions
+27
-11
.Makefile
.Makefile
+4
-4
README.md
README.md
+8
-4
argotk.hs
argotk.hs
+15
-3
No files found.
.Makefile
View file @
9941d842
...
...
@@ -6,16 +6,16 @@ all: generate-completions README.md
generate-completions: completions/zsh/_argotk.hs completions/bash/argotk.sh
completions/zsh/_argotk.hs: argotk.hs default.nix
nix-shell -A dev-test --run "bash -c './argotk.hs --zsh-completion-script ./argotk.hs > completions/zsh/_argotk.hs'"
bash -c './argotk.hs --zsh-completion-script ./argotk.hs > completions/zsh/_argotk.hs'
completions/bash/argotk.sh: argotk.hs default.nix
nix-shell -A dev-test --run "bash -c './argotk.hs --bash-completion-script ./argotk.hs > completions/bash/argotk.sh'"
bash -c './argotk.hs --bash-completion-script ./argotk.hs > completions/bash/argotk.sh'
README.md: .README.md argotk.hs default.nix
nix-shell -A dev-test --run "pandoc --filter `which panpipe` .README.md -o README.md"
pandoc --filter `which panpipe` .README.md -o README.md
README.html: README.md
nix-shell -A dev-test --run "pandoc README.md -o README.html"
pandoc README.md -o README.html
.PHONY:clean
clean:
...
...
README.md
View file @
9941d842
...
...
@@ -47,11 +47,15 @@ Output:
Usage: argotk.hs COMMAND
Available options:
COMMAND T
arget for the greeting
COMMAND T
ype of action to run
-h,--help Show this help text
Available commands:
clean
daemon
helloworld
clean Clean sockets, logfiles.
daemon Set up and launch the daemon in synchronous mode,
with properly cleaned sockets, logfiles.
application Setup stack and run an arbitrary command in a
container.
helloworld Setup stack and check that hello world app sends
message back to cmd.
```
argotk.hs
View file @
9941d842
...
...
@@ -17,13 +17,25 @@ import Control.Monad
opts
::
Parser
(
IO
()
)
opts
=
subparser
(
command
"clean"
(
info
(
pure
$
runClean
def
)
idm
)
<>
help
"Target for the greeting"
<>
command
"daemon"
(
info
(
pure
$
runDaemon
def
)
idm
)
<>
command
"helloworld"
(
info
(
pure
$
runHelloWorld
def
)
idm
)
)
(
command
"clean"
(
info
(
pure
$
runClean
def
)
(
progDesc
"Clean sockets, logfiles."
))
<>
command
"daemon"
(
info
(
pure
$
runDaemon
def
)
(
progDesc
"Set up and launch the daemon in synchronous mode,
\
\
with properly cleaned sockets, logfiles."
))
<>
command
"application"
(
info
(
runApp
<$>
argument
str
idm
)
(
progDesc
"Setup stack and run an arbitrary command in a container."
))
<>
command
"helloworld"
(
info
(
pure
$
runHelloWorld
def
)
(
progDesc
"Setup stack and check that hello world app sends
\
\
message back to cmd."
))
<>
help
"Type of action to run"
)
main
::
IO
()
main
=
join
$
execParser
(
info
(
opts
<**>
helper
)
idm
)
runApp
::
Text
->
IO
()
runApp
app
=
runSimpleStack
$
def
{
app
=
app
}
runHelloWorld
::
StackArgs
->
IO
()
runHelloWorld
a
@
StackArgs
{
..
}
=
do
let
passStr
=
"HelloWorldFromApp"
...
...
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