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
Mirrors
biopet.biopet
Commits
37e92018
Commit
37e92018
authored
Sep 08, 2015
by
Peter van 't Hof
Browse files
Adding stdin
parent
1b4d398c
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
View file @
37e92018
...
...
@@ -227,7 +227,7 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
}
private
[
core
]
var
_inputAsStdin
=
false
def
inputAsSt
ream
=
_inputAsStdin
def
inputAsSt
din
=
_inputAsStdin
private
[
core
]
var
_outputAsStdout
=
false
def
outputAsStsout
=
_outputAsStdout
...
...
@@ -258,13 +258,23 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
}
}
def
>
(
file
:
File
)
:
BiopetCommandLineFunction
=
{
def
:<:
(
file
:
File
)
:
BiopetCommandLineFunction
=
{
this
.
_inputAsStdin
=
true
this
.
stdinFile
=
Some
(
file
)
this
}
def
>
(
file
:
File
)
:
BiopetCommandLineFunction
=
{
this
.
_outputAsStdout
=
true
this
.
stdoutFile
=
Some
(
file
)
this
}
var
stdoutFile
:
Option
[
File
]
=
None
@Output
(
required
=
false
)
private
[
core
]
var
stdoutFile
:
Option
[
File
]
=
None
@Input
(
required
=
false
)
private
[
core
]
var
stdinFile
:
Option
[
File
]
=
None
/**
* This function needs to be implemented to define the command that is executed
...
...
@@ -279,10 +289,9 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
*/
override
final
def
commandLine
:
String
=
{
preCmdInternal
()
val
cmd
=
stdoutFile
match
{
case
Some
(
file
)
=>
cmdLine
+
" > "
+
file
case
_
=>
cmdLine
}
val
cmd
=
cmdLine
+
stdinFile
.
map
(
" < "
+
_
).
getOrElse
(
""
)
+
stdoutFile
.
map
(
" > "
+
_
).
getOrElse
(
""
)
addJobReportBinding
(
"command"
,
cmd
)
cmd
}
...
...
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