Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Reis
argotest
Commits
9941d842
Commit
9941d842
authored
Dec 13, 2018
by
Valentin Reis
Browse files
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
.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
Supports
Markdown
0%
Try again
or
attach a new 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