[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: improve the 'config' command from Sand
From: |
gnunet |
Subject: |
[libeufin] branch master updated: improve the 'config' command from Sandbox |
Date: |
Sat, 17 Jul 2021 10:02:17 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 9f2c891 improve the 'config' command from Sandbox
9f2c891 is described below
commit 9f2c891ff6a565969bf5c658503e790ece977a26
Author: ms <ms@taler.net>
AuthorDate: Sat Jul 17 10:02:06 2021 +0200
improve the 'config' command from Sandbox
---
sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt | 2 +-
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
index 99bed21..b840c8c 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -101,7 +101,7 @@ class SandboxConfigEntity(id: EntityID<Long>) :
LongEntity(id) {
var allowRegistrations by SandboxConfigsTable.allowRegistrations
var bankDebtLimit by SandboxConfigsTable.bankDebtLimit
var usersDebtLimit by SandboxConfigsTable.usersDebtLimit
- var name by SandboxConfigsTable.hostname
+ var hostname by SandboxConfigsTable.hostname
}
object SandboxUsersTable : LongIdTable() {
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index f1836f0..a6affd0 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -59,6 +59,7 @@ import org.jetbrains.exposed.sql.statements.api.ExposedBlob
import java.time.Instant
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.context
+import com.github.ajalt.clikt.parameters.arguments.argument
import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.output.CliktHelpFormatter
import com.github.ajalt.clikt.parameters.options.default
@@ -110,11 +111,16 @@ class Config : CliktCommand("Insert one configuration
into the database") {
helpFormatter = CliktHelpFormatter(showDefaultValues = true)
}
}
-
- private val currencyOption by option().default("EUR")
- private val bankDebtLimitOption by option().int().default(1000000)
- private val usersDebtLimitOption by option().int().default(1000)
- private val allowRegistrationsOption by option().flag(default = true)
+ private val hostnameOption by argument(
+ "HOSTNAME", help="hostname that serves this configuration"
+ )
+ private val currencyOption by option("--currency").default("EUR")
+ private val bankDebtLimitOption by
option("--bank-debt-limit").int().default(1000000)
+ private val usersDebtLimitOption by
option("--users-debt-limit").int().default(1000)
+ private val allowRegistrationsOption by option(
+ "--allow-registrations",
+ help="(default: true)" /* mentioning here as help message did not. */
+ ).flag(default = true)
override fun run() {
val dbConnString = getDbConnFromEnv(SANDBOX_DB_ENV_VAR_NAME)
@@ -126,6 +132,7 @@ class Config : CliktCommand("Insert one configuration into
the database") {
bankDebtLimit = bankDebtLimitOption
usersDebtLimit = usersDebtLimitOption
allowRegistrations = allowRegistrationsOption
+ hostname = hostnameOption
}
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: improve the 'config' command from Sandbox,
gnunet <=