diff options
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.kt | 3 |
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 | */ |
8 | internal class Command(private val cmd: String) { | 8 | internal 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 | } |