diff options
| author | 2023-07-12 11:29:01 +0700 | |
|---|---|---|
| committer | 2023-07-12 11:29:01 +0700 | |
| commit | b4283865826de4cd0fd240001b4432dca8df9c77 (patch) | |
| tree | 6f19968f2be83735b70816bcf21212e0086734f5 | |
| parent | xs_mime.h: .opus mime is audio/ogg (diff) | |
| download | snac2-b4283865826de4cd0fd240001b4432dca8df9c77.tar.gz snac2-b4283865826de4cd0fd240001b4432dca8df9c77.tar.xz snac2-b4283865826de4cd0fd240001b4432dca8df9c77.zip | |
utils.c: Prompt does not need \n
| -rw-r--r-- | utils.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -85,7 +85,7 @@ int snac_init(const char *basedir) | |||
| 85 | FILE *f; | 85 | FILE *f; |
| 86 | 86 | ||
| 87 | if (basedir == NULL) { | 87 | if (basedir == NULL) { |
| 88 | printf("Base directory:\n"); | 88 | printf("Base directory: "); |
| 89 | srv_basedir = xs_strip_i(xs_readline(stdin)); | 89 | srv_basedir = xs_strip_i(xs_readline(stdin)); |
| 90 | } | 90 | } |
| 91 | else | 91 | else |
| @@ -98,7 +98,7 @@ int snac_init(const char *basedir) | |||
| 98 | srv_basedir = xs_crop_i(srv_basedir, 0, -1); | 98 | srv_basedir = xs_crop_i(srv_basedir, 0, -1); |
| 99 | 99 | ||
| 100 | if (mtime(srv_basedir) != 0.0) { | 100 | if (mtime(srv_basedir) != 0.0) { |
| 101 | printf("ERROR: directory '%s' must not exist\n", srv_basedir); | 101 | printf("ERROR: directory '%s' must not exist.\n", srv_basedir); |
| 102 | return 1; | 102 | return 1; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| @@ -107,14 +107,14 @@ int snac_init(const char *basedir) | |||
| 107 | xs *layout = xs_number_new(disk_layout); | 107 | xs *layout = xs_number_new(disk_layout); |
| 108 | srv_config = xs_dict_set(srv_config, "layout", layout); | 108 | srv_config = xs_dict_set(srv_config, "layout", layout); |
| 109 | 109 | ||
| 110 | printf("Network address [%s]:\n", xs_dict_get(srv_config, "address")); | 110 | printf("Network address [%s]: ", xs_dict_get(srv_config, "address")); |
| 111 | { | 111 | { |
| 112 | xs *i = xs_strip_i(xs_readline(stdin)); | 112 | xs *i = xs_strip_i(xs_readline(stdin)); |
| 113 | if (*i) | 113 | if (*i) |
| 114 | srv_config = xs_dict_set(srv_config, "address", i); | 114 | srv_config = xs_dict_set(srv_config, "address", i); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | printf("Network port [%d]:\n", (int)xs_number_get(xs_dict_get(srv_config, "port"))); | 117 | printf("Network port [%d]: ", (int)xs_number_get(xs_dict_get(srv_config, "port"))); |
| 118 | { | 118 | { |
| 119 | xs *i = xs_strip_i(xs_readline(stdin)); | 119 | xs *i = xs_strip_i(xs_readline(stdin)); |
| 120 | if (*i) { | 120 | if (*i) { |
| @@ -123,7 +123,7 @@ int snac_init(const char *basedir) | |||
| 123 | } | 123 | } |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | printf("Host name:\n"); | 126 | printf("Host name: "); |
| 127 | { | 127 | { |
| 128 | xs *i = xs_strip_i(xs_readline(stdin)); | 128 | xs *i = xs_strip_i(xs_readline(stdin)); |
| 129 | if (*i == '\0') | 129 | if (*i == '\0') |
| @@ -132,7 +132,7 @@ int snac_init(const char *basedir) | |||
| 132 | srv_config = xs_dict_set(srv_config, "host", i); | 132 | srv_config = xs_dict_set(srv_config, "host", i); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | printf("URL prefix:\n"); | 135 | printf("URL prefix: "); |
| 136 | { | 136 | { |
| 137 | xs *i = xs_strip_i(xs_readline(stdin)); | 137 | xs *i = xs_strip_i(xs_readline(stdin)); |
| 138 | 138 | ||
| @@ -144,7 +144,7 @@ int snac_init(const char *basedir) | |||
| 144 | } | 144 | } |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | printf("Admin email address (optional):\n"); | 147 | printf("Admin email address (optional): "); |
| 148 | { | 148 | { |
| 149 | xs *i = xs_strip_i(xs_readline(stdin)); | 149 | xs *i = xs_strip_i(xs_readline(stdin)); |
| 150 | 150 | ||