X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-setup.c;h=9a66810db385cbbb9e64f93d7af4f1953546be44;hp=475248b1f9735b2e10f00f013deffa0baac85e7a;hb=60ac94fe58635f9c40724afa0f35965fc9ff1afc;hpb=4ef2106792439f5ade157b3ba3b8f7fa86fcb3ed diff --git a/notmuch-setup.c b/notmuch-setup.c index 475248b1..9a66810d 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Carl Worth */ @@ -140,11 +140,18 @@ notmuch_setup_command (notmuch_config_t *config, fflush (stdout); \ if (getline (&response, &response_size, stdin) < 0) { \ printf ("Exiting.\n"); \ - exit (1); \ + exit (EXIT_FAILURE); \ } \ chomp_newline (response); \ } while (0) + if (notmuch_minimal_options ("setup", argc, argv) < 0) + return EXIT_FAILURE; + + if (notmuch_requested_db_uuid) + fprintf (stderr, "Warning: ignoring --uuid=%s\n", + notmuch_requested_db_uuid); + if (notmuch_config_is_new (config)) welcome_message_pre_setup (); @@ -223,12 +230,11 @@ notmuch_setup_command (notmuch_config_t *config, g_ptr_array_free (tags, TRUE); } + if (notmuch_config_save (config)) + return EXIT_FAILURE; - if (! notmuch_config_save (config)) { - if (notmuch_config_is_new (config)) - welcome_message_post_setup (); - return 0; - } else { - return 1; - } + if (notmuch_config_is_new (config)) + welcome_message_post_setup (); + + return EXIT_SUCCESS; }