Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Consistent failure messages
Browse files Browse the repository at this point in the history
  • Loading branch information
desaperados committed Mar 20, 2019
1 parent 4257515 commit 374bc9e
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions libexec/mcd/mcd---fail
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -e
err=${1##*/}
act=${err%\:*}
echo "Error:${err#*\:}" >&2; echo >&2
echo $err >&2; echo >&2
mcd >&2 ${act#*-} --help
exit 1
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-cdp-dai
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
case $1 in
exit) {
[ -n "$2" ] || mcd --fail "cdp: Please specify a dai amount"
[ -n "$2" ] || mcd --fail "mcd-cdp: Please specify a dai amount"
wad=$(seth --to-uint256 $(seth --to-hex $(seth --to-wei "$2 eth")))
if [[ $MCD_PROXY == yes ]]; then
sig="exit(address,address,uint,address,uint)"
Expand Down
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-cdp-gem
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
case $1 in
exit) {
[ -n "$2" ] || mcd --fail "cdp: Please specify a gem amount"
[ -n "$2" ] || mcd --fail "mcd-cdp: Please specify a gem amount"
join=$(mcd gem adapter)
wad=$(seth --to-uint256 $(seth --to-hex $(seth --to-wei "$2 eth")))
if [[ $MCD_PROXY == yes ]]; then
Expand Down
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-dai-exit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
[ -n "$1" ] || mcd --fail "dai: Please specify an exit amount"
[ -n "$1" ] || mcd --fail "mcd-dai: Please specify an exit amount"

urn=$(mcd --require-urn dai)
guy=$(mcd --to-address ${2:-$ETH_FROM})
Expand Down
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-dai-join
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
[ -n "$1" ] || mcd --fail "dai: Please specify a join amount"
[ -n "$1" ] || mcd --fail "mcd-dai: Please specify a join amount"

approve() {
seth send "$MCD_DAI" "approve(address)" $MCD_JOIN_DAI
Expand Down
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-gem-exit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
[ -n "$1" ] || mcd --fail "gem: Please specify an exit amount"
[ -n "$1" ] || mcd --fail "mcd-gem: Please specify an exit amount"

urn=$(mcd --require-urn gem)
guy=$(mcd --to-address ${2:-$ETH_FROM})
Expand Down
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-gem-join
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
[ -n "$1" ] || mcd --fail "gem: Please specify a join amount"
[ -n "$1" ] || mcd --fail "mcd-gem: Please specify a join amount"

mcd---require-ilk-opt

Expand Down
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-unwrap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Usage: mcd unwrap <amount>
set -e
mcd --require-from $0 &>/dev/null
[ -n "$1" ] || mcd --fail "wrap: Please specify an amount to wrap"
[ -n "$1" ] || mcd --fail "mcd-wrap: Please specify an amount to wrap"
seth send ${ETH?} 'withdraw(uint)' $(seth --to-word $(seth --to-wei "$1 eth"))

[[ $SETH_ASYNC == yes ]] && exit 1
Expand Down
2 changes: 1 addition & 1 deletion libexec/mcd/mcd-wrap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Usage: mcd wrap <amount>
set -e
mcd --require-from $0 &>/dev/null
[ -n "$1" ] || mcd --fail "wrap: Please specify an amount to wrap"
[ -n "$1" ] || mcd --fail "mcd-wrap: Please specify an amount to wrap"
seth send ${ETH?} --value $(seth --to-wei "$1 eth")

[[ $SETH_ASYNC == yes ]] && exit 1
Expand Down

0 comments on commit 374bc9e

Please sign in to comment.