about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorlogin (tilde.club) <login@tilde.club>2020-07-24 16:25:37 +0000
committerlogin (tilde.club) <login@tilde.club>2020-07-24 16:25:37 +0000
commit41f968db2a6680e27e35ff21a93bc55d70dc26d7 (patch)
tree01fd14c034d2af188f974fffed6fb91cb77107ef
parent08783c2043ba8cf9837267905a32e515a4300c2e (diff)
downloadtcoin-41f968db2a6680e27e35ff21a93bc55d70dc26d7.tar.gz
Custom host name possible in tcoin --help now
1. Custom host name now possible in tcoin --help
2. Changes to ntcoin and ntcoin_openbsd_tildeinstitute to fix a bug in -d/--def.
3. Changes to ntcoin and ntcoin_openbsd_tildeinstitute to check for the correct number of arguments.
4. Changes to ntcoin and ntcoin_openbsd_tildeinstitute to include the host name as a preprocessor constant.
-rwxr-xr-x[-rw-r--r--]ntcoin17
-rwxr-xr-xntcoin_openbsd_tildeinstitute15
-rw-r--r--tcoin.cpp7
3 files changed, 27 insertions, 12 deletions
diff --git a/ntcoin b/ntcoin
index 5f7582d..36b3249 100644..100755
--- a/ntcoin
+++ b/ntcoin
@@ -1,15 +1,15 @@
-#!/usr/local/bin/bash
+#!/usr/bin/bash
 
 if [ "$#" -eq 0 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]
 then
   /bin/echo "Usage:"
-  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> <n> : to create the tcoin directory in <path (no slash)> with the executable saved to <bin path (no slash)> and with <n> basecoins per user"
-  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> [ --def | -d ]: to print only the #define preprocessor directives without creating any directories"
+  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> <n> <host name>: to create the tcoin directory in <path (no slash)> with the executable saved to <bin path (no slash)> and with <n> basecoins per user with the help showing the host name <host name>"
+  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> <host name> --def | -d: to print only the #define preprocessor directives without creating any directories"
   /bin/echo "  ntcoin [ --help | -h ] : to print this help"
-elif [ "$3" = "--def" ] || [ "$3" = "-d" ]
+elif [ "$4" = "--def" ] || [ "$4" = "-d" ]
 then
   /bin/echo "Printing tcoin.cpp (and pcoin.cpp) preprocessor directives."
-  /bin/echo 'Paste the following in '`/usr/bin/realpath -s $2`'/tcoin/bin/tcoin_defs.cpp (and '`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin_defs.cpp):
+  /bin/echo 'Paste the following in '`/usr/bin/realpath -s $1`'/tcoin/bin/tcoin_defs.cpp (and '`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin_defs.cpp):
 '
   /bin/echo '#define TCOIN_PATH "'`/usr/bin/realpath -s $1`'/tcoin"
 #define TCOIN_MSG_PATH "'`/usr/bin/realpath -s $1`'/tcoin/messages/"
@@ -24,6 +24,7 @@ then
 #define TCOIN_SCRYPT_PATH "'`/usr/bin/realpath -s $1`'/tcoin/bin/scrypt"
 #define PCOIN_BIN_PATH "'`/usr/bin/realpath -s $2`'/pcoin"
 #define PCOIN_BIN_PATH_W_SPACE "'`/usr/bin/realpath -s $2`'/pcoin "
+#define TCOIN_HOST_NAME "'$3'"
 #define KROWBAR_OFF
 #define DA_OFF
 #define MINERCOIN_OFF'
@@ -33,6 +34,11 @@ else
     ''|*[!0-9]*) /bin/echo "Sorry, the number of basecoins <n> should be a positive integer."; exit 1 ;;
     *) ;;
   esac
+  if [ "$#" -ne 4 ]
+  then
+    /bin/echo "Sorry, the number of arguments must be exactly 4."
+    exit 1
+  fi
   if [ -d "`/usr/bin/realpath -s $1`/tcoin" ]
   then
     /bin/echo "Sorry, '`/usr/bin/realpath -s $1`/tcoin' already exists."
@@ -152,6 +158,7 @@ else
 #define TCOIN_BIN_PATH_W_SPACE "'`/usr/bin/realpath -s $2`'/tcoin "
 #define TCOIN_PATH_W_SLASH "'`/usr/bin/realpath -s $1`'/tcoin/"
 #define TCOIN_SCRYPT_PATH "'`/usr/bin/realpath -s $1`'/tcoin/bin/scrypt"
+#define TCOIN_HOST_NAME "'$4'"
 #define KROWBAR_OFF
 #define DA_OFF
 #define MINERCOIN_OFF' > "`/usr/bin/realpath -s $1`/tcoin/bin/tcoin_defs.cpp"
diff --git a/ntcoin_openbsd_tildeinstitute b/ntcoin_openbsd_tildeinstitute
index 129e3b8..5f91e88 100755
--- a/ntcoin_openbsd_tildeinstitute
+++ b/ntcoin_openbsd_tildeinstitute
@@ -3,13 +3,13 @@
 if [ "$#" -eq 0 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]
 then
   /bin/echo "Usage:"
-  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> <n> : to create the tcoin directory in <path (no slash)> with the executable saved to <bin path (no slash)> and with <n> basecoins per user"
-  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> [ --def | -d ]: to print only the #define preprocessor directives without creating any directories"
+  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> <n> <host name>: to create the tcoin directory in <path (no slash)> with the executable saved to <bin path (no slash)> and with <n> basecoins per user with the help showing the host name <host name>"
+  /bin/echo "  ntcoin <path (no slash)> <bin path (no slash)> <host name> --def | -d: to print only the #define preprocessor directives without creating any directories"
   /bin/echo "  ntcoin [ --help | -h ] : to print this help"
-elif [ "$3" = "--def" ] || [ "$3" = "-d" ]
+elif [ "$4" = "--def" ] || [ "$4" = "-d" ]
 then
   /bin/echo "Printing tcoin.cpp (and pcoin.cpp) preprocessor directives."
-  /bin/echo 'Paste the following in '`/usr/local/bin/grealpath -s $2`'/tcoin/bin/tcoin_defs.cpp (and '`/usr/local/bin/grealpath -s $1`'/tcoin/bin/pcoin_defs.cpp):
+  /bin/echo 'Paste the following in '`/usr/local/bin/grealpath -s $1`'/tcoin/bin/tcoin_defs.cpp (and '`/usr/local/bin/grealpath -s $1`'/tcoin/bin/pcoin_defs.cpp):
 '
   /bin/echo '#define TCOIN_PATH "'`/usr/local/bin/grealpath -s $1`'/tcoin"
 #define TCOIN_MSG_PATH "'`/usr/local/bin/grealpath -s $1`'/tcoin/messages/"
@@ -24,6 +24,7 @@ then
 #define TCOIN_SCRYPT_PATH "'`/usr/local/bin/grealpath -s $1`'/tcoin/bin/scrypt"
 #define PCOIN_BIN_PATH "'`/usr/local/bin/grealpath -s $2`'/pcoin"
 #define PCOIN_BIN_PATH_W_SPACE "'`/usr/local/bin/grealpath -s $2`'/pcoin "
+#define TCOIN_HOST_NAME "'$3'"
 #define KROWBAR_OFF
 #define DA_OFF
 #define MINERCOIN_OFF'
@@ -33,6 +34,11 @@ else
     ''|*[!0-9]*) /bin/echo "Sorry, the number of basecoins <n> should be a positive integer."; exit 1 ;;
     *) ;;
   esac
+  if [ "$#" -ne 4 ]
+  then
+    /bin/echo "Sorry, the number of arguments must be exactly 4."
+    exit 1
+  fi
   if [ -d "`/usr/local/bin/grealpath -s $1`/tcoin" ]
   then
     /bin/echo "Sorry, '`/usr/local/bin/grealpath -s $1`/tcoin' already exists."
@@ -152,6 +158,7 @@ else
 #define TCOIN_BIN_PATH_W_SPACE "'`/usr/local/bin/grealpath -s $2`'/tcoin "
 #define TCOIN_PATH_W_SLASH "'`/usr/local/bin/grealpath -s $1`'/tcoin/"
 #define TCOIN_SCRYPT_PATH "'`/usr/local/bin/grealpath -s $1`'/tcoin/bin/scrypt"
+#define TCOIN_HOST_NAME "'$4'"
 #define KROWBAR_OFF
 #define DA_OFF
 #define MINERCOIN_OFF' > "`/usr/local/bin/grealpath -s $1`/tcoin/bin/tcoin_defs.cpp"
diff --git a/tcoin.cpp b/tcoin.cpp
index 5c9226e..7e01d1f 100644
--- a/tcoin.cpp
+++ b/tcoin.cpp
@@ -1496,10 +1496,11 @@ int send(const char* sender_username, const char* receiver_username, const long
 
 void help(long long int &base_amount)
 {
-  std::cout << "\n - tildecoin (also called tcoin) is tilde.town's very own digital (non-crypto) currency.";
-  std::cout << "\n - to participate in tilde.town's internal economy by creating your own tcoin account, run `tcoin init`.";
+  std::cout << "\n - tildecoin (also called tcoin) is " << TCOIN_HOST_NAME << "'s very own digital (non-crypto) currency.";
+  std::cout << "\n - to participate in " << TCOIN_HOST_NAME << "'s internal economy by creating your own tcoin account, run `tcoin init`.";
   std::cout << "\n - all users get "; cout_formatted_amount(base_amount); std::cout << " coins to start, and can send and receive coins from other users (and programs).";
   std::cout << "\n - more information about tildecoin is available at \"https://tilde.town/~login/tcoin.html\".\n";
+
   std::cout << "\n`tcoin`: check your balance and the 10 latest lines of messages";
   std::cout << "\n`tcoin on`: log on to tildecoin";
   std::cout << "\n`tcoin off`: out out of tildecoin";
@@ -1514,7 +1515,7 @@ void help(long long int &base_amount)
   std::cout << "\n`tcoin silentsend <username> <amount> [\"<message>\"]`, `tcoin send -s <username> <amount> [\"<message>\"]` or `tcoin -ss <username> <amount> [\"<message>\"]`: send <amount> tildecoins to <username> with an optional (as indicated by [ and ], which should not be included in the actual comment) message included without printing anything";
   std::cout << "\nIn the commands with `<username> <amount>`, switching the two arguments around (i.e., from `<username> <amount>` to `<amount> <username>`) will also work";
   std::cout << "\n`tcoin --help`, `tcoin help` or `tcoin -h`: print this help text";
-  std::cout << "\nSend an email to `login@tilde.town` (tilde.town local email) or `login@tilde.team` (internet-wide email), or `/query login` on IRC to request a passphrase reset.\n\n";
+  std::cout << "\nSend an email to "; `login@tilde.town` (tilde.town local email) or `login@tilde.team` (internet-wide email), or `/query login` on IRC to request a passphrase reset.\n\n";
 }
 
 bool is_number(const char* test_string)
s/dwm/blame/dwm.h?h=5.2&id=9833610356f7ce033589680fddf87000e5788774'>^
bf35794 ^


b5159df ^
8b59083 ^
b5159df ^
1076f2b
da2bbd3 ^
3399650 ^
1173723 ^

a05beb6 ^
2e836ec ^
a05beb6 ^
9d73909 ^
901b3ed ^
b355755 ^
1076f2b
72707c2 ^
bf35794 ^
7e597ae ^
1076f2b

b355755 ^
8cc7f3b ^
e995c1b ^

66da153 ^

bf35794 ^
26157e6 ^
efa7e51 ^
bf35794 ^


bf35794 ^
39677ec ^
439e15d ^
dba2306 ^
3399650 ^
adaa28a ^
dba2306 ^
adaa28a ^
adaa28a ^
adaa28a ^
04eb016 ^
adaa28a ^

4688ad1 ^
adaa28a ^
3399650 ^
d7e1708 ^
dba2306 ^
c0705ee ^
adaa28a ^
c0705ee ^

8cc7f3b ^
d7e1708 ^
dba2306 ^
29355bd ^
b6ad663 ^
b9da4b0 ^
9e8b325 ^
adaa28a ^
c47da14 ^
dba2306 ^
adaa28a ^
9e8b325 ^
dba2306 ^
e21d93b ^
937cabf ^
72707c2 ^
aaad7bf ^
19da197 ^
19da197 ^
29355bd ^
8b59083 ^
8b59083 ^
adaa28a ^
d4b7a9a ^
c47da14 ^
aa13727 ^

8a6679b ^
aa13727 ^




3a1343a ^
aa13727 ^



daae3bb ^
aa13727 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141