# HG changeset patch # User zas_ # Date 1210690178 0 # Node ID 9bcfd6d7a902aa12fc19d11fd8ba40524b1eb451 # Parent ac87e9688188cacc9211c5d143cc11609d54b866 Display a message when invalid remote options are used. diff -r ac87e9688188 -r 9bcfd6d7a902 src/main.c --- a/src/main.c Tue May 13 14:35:51 2008 +0000 +++ b/src/main.c Tue May 13 14:49:38 2008 +0000 @@ -232,6 +232,7 @@ { GList *list = NULL; GList *remote_list = NULL; + GList *remote_errors = NULL; gint remote_do = FALSE; gchar *first_dir = NULL; @@ -307,7 +308,7 @@ if (!remote_do) { remote_do = TRUE; - remote_list = remote_build_list(remote_list, argc, argv); + remote_list = remote_build_list(remote_list, argc - i, &argv[i], &remote_errors); } } else if (strcmp(cmd_line, "-rh") == 0 || @@ -386,6 +387,22 @@ if (remote_do) { + if (remote_errors) + { + GList *work = remote_errors; + + printf_term(_("Invalid or ignored remote options: ")); + while (work) + { + gchar *opt = work->data; + + printf_term("%s%s", (work == remote_errors) ? "" : ", ", opt); + work = work->next; + } + + printf_term(_("\nUse --remote-help for valid remote options.\n")); + } + remote_control(argv[0], remote_list, *path, list, *collection_list); } g_list_free(remote_list); diff -r ac87e9688188 -r 9bcfd6d7a902 src/remote.c --- a/src/remote.c Tue May 13 14:35:51 2008 +0000 +++ b/src/remote.c Tue May 13 14:49:38 2008 +0000 @@ -663,7 +663,7 @@ } } -GList *remote_build_list(GList *list, int argc, char *argv[]) +GList *remote_build_list(GList *list, int argc, char *argv[], GList **errors) { gint i; @@ -677,6 +677,10 @@ { list = g_list_append(list, argv[i]); } + else if (errors) + { + *errors = g_list_append(*errors, argv[i]); + } i++; } diff -r ac87e9688188 -r 9bcfd6d7a902 src/remote.h --- a/src/remote.h Tue May 13 14:35:51 2008 +0000 +++ b/src/remote.h Tue May 13 14:49:38 2008 +0000 @@ -33,7 +33,7 @@ void remote_close(RemoteConnection *rc); -GList *remote_build_list(GList *list, int argc, char *argv[]); +GList *remote_build_list(GList *list, int argc, char *argv[], GList **errors); void remote_help(void); void remote_control(const gchar *arg_exec, GList *remote_list, const gchar *path, GList *cmd_list, GList *collection_list);