aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/commands/Command.kt
diff options
context:
space:
mode:
authorpacien2018-02-16 18:42:02 +0100
committerpacien2018-02-16 18:42:02 +0100
commitd360837d494a86930b8323a99691dc52925eb7ea (patch)
tree2fc1a8b1bf70d0fdbaa45a0185b0158f23a29a5d /app/src/main/java/org/pacien/tincapp/commands/Command.kt
parent5a4f0f964e41847b10ed44ac1f5b2bbf060102c3 (diff)
downloadtincapp-d360837d494a86930b8323a99691dc52925eb7ea.tar.gz
Cosmetic
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/commands/Command.kt')
-rw-r--r--app/src/main/java/org/pacien/tincapp/commands/Command.kt3
1 files changed, 0 insertions, 3 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/commands/Command.kt b/app/src/main/java/org/pacien/tincapp/commands/Command.kt
index cb95619..ccb5f10 100644
--- a/app/src/main/java/org/pacien/tincapp/commands/Command.kt
+++ b/app/src/main/java/org/pacien/tincapp/commands/Command.kt
@@ -6,7 +6,6 @@ import java.util.*
6 * @author pacien 6 * @author pacien
7 */ 7 */
8internal class Command(private val cmd: String) { 8internal class Command(private val cmd: String) {
9
10 private data class Option(val key: String, val value: String?) { 9 private data class Option(val key: String, val value: String?) {
11 fun toCommandLineOption(): String = if (value != null) "--$key=$value" else "--$key" 10 fun toCommandLineOption(): String = if (value != null) "--$key=$value" else "--$key"
12 } 11 }
@@ -25,7 +24,5 @@ internal class Command(private val cmd: String) {
25 } 24 }
26 25
27 fun asList(): List<String> = listOf(cmd) + opts.map { it.toCommandLineOption() } + args 26 fun asList(): List<String> = listOf(cmd) + opts.map { it.toCommandLineOption() } + args
28
29 fun asArray(): Array<String> = this.asList().toTypedArray() 27 fun asArray(): Array<String> = this.asList().toTypedArray()
30
31} 28}