Skip to content

Commit 0351ee8

Browse files
committed
Changes to reflect 0.9.5 API
1 parent 32a45f0 commit 0351ee8

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ object RetrieveCommand extends Command {
3333

3434
override def execute(implicit config: Config, backend: SttpBackend[Id, Nothing]): Unit = {
3535

36-
//Checks whether the ID should be loaded from a file or not, and either returns the first line
37-
// of the given file if it is, or the specified ID otherwise
38-
def checkTarget: String = {
36+
val queriedId: String = {
3937
if (config.opts.contains("file")) {
4038
val source = Source.fromFile(config.args.head)
4139
val target = source.getLines.next()
@@ -47,23 +45,17 @@ object RetrieveCommand extends Command {
4745
}
4846

4947
val result = executeGet(
50-
Seq("retrieve", checkTarget),
51-
Map("pretty" -> "")
48+
Seq("retrieve", queriedId)
5249
)
5350

5451
result.foreach(s => {
5552
if (config.raw) {
5653
reportResult.apply(s)
5754
}
5855
if (!config.raw || !config.csv.equals("")) {
59-
60-
//TODO: Direct convertTo[List[RetrieveResult]] not working ???
61-
62-
6356
val jsonArr = s.parseJson.asInstanceOf[JsArray].elements
6457
val retrieveResults = jsonArr.map(r => r.convertTo[RetrieveResult])
6558

66-
success.apply(s"Found ${retrieveResults.size} item(s).")
6759
reportResult.apply(retrieveResults)
6860
if (!config.csv.equals("")) {
6961
exportResult.apply(retrieveResults)

0 commit comments

Comments
 (0)