Skip to content
Snippets Groups Projects
Commit 2f32d914 authored by Moul's avatar Moul
Browse files

[enh] #235: tx: use Mutually exclusive for amount, amountUD, allSources options

parent 4d532878
No related branches found
No related tags found
1 merge request!146Merge dev into master branch to complete v0.8.0 development cycle
......@@ -18,9 +18,10 @@ along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
from re import compile, search
import math
from time import sleep
from tabulate import tabulate
from click import command, option, FloatRange
from tabulate import tabulate
from silkaj.cli_tools import MutuallyExclusiveOption
from silkaj.network_tools import ClientInstance, HeadBlock
from silkaj.crypto_tools import check_public_key
from silkaj.tools import message_exit, CurrencySymbol, coroutine
......@@ -40,9 +41,27 @@ from duniterpy.documents.transaction import OutputSource, Unlock, SIGParameter
@command("tx", help="Send transaction")
@option("--amount", type=FloatRange(0.01), help="Quantitative value")
@option("--amountUD", type=float, help="Relative value")
@option("--allSources", is_flag=True, help="Send all sources")
@option(
"--amount",
type=FloatRange(0.01),
help="Quantitative value",
cls=MutuallyExclusiveOption,
mutually_exclusive=["amountud", "allsources"],
)
@option(
"--amountUD",
type=float,
help="Relative value",
cls=MutuallyExclusiveOption,
mutually_exclusive=["amount", "allsources"],
)
@option(
"--allSources",
is_flag=True,
help="Send all sources",
cls=MutuallyExclusiveOption,
mutually_exclusive=["amount", "amountud"],
)
@option(
"--output",
required=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment