Ticket #4556: color definitions in the "c.syntax" highlight file.
[midnight-commander.git] / src / args.c
blob81e9becca57264c561f52b0677d56d4904d4a637
1 /*
2 Handle command line arguments.
4 Copyright (C) 2009-2024
5 Free Software Foundation, Inc.
7 Written by:
8 Slava Zanko <slavazanko@gmail.com>, 2009.
9 Andrew Borodin <aborodin@vmail.ru>, 2011, 2012.
11 This file is part of the Midnight Commander.
13 The Midnight Commander is free software: you can redistribute it
14 and/or modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation, either version 3 of the License,
16 or (at your option) any later version.
18 The Midnight Commander is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #include <config.h>
28 #include <stdlib.h>
29 #include <stdio.h>
31 #include "lib/global.h"
32 #include "lib/tty/tty.h"
33 #include "lib/strutil.h"
34 #include "lib/vfs/vfs.h"
35 #include "lib/util.h" /* x_basename() */
37 #include "src/textconf.h"
39 #ifdef USE_INTERNAL_EDIT
40 #include "editor/edit.h" /* edit_arg_t */
41 #endif
43 #include "src/args.h"
45 /*** external variables **************************************************************************/
47 /*** global variables ****************************************************************************/
49 /* If true, assume we are running on an xterm terminal */
50 gboolean mc_args__force_xterm = FALSE;
52 gboolean mc_args__nomouse = FALSE;
54 /* Force colors, only used by Slang */
55 gboolean mc_args__force_colors = FALSE;
57 /* Don't load keymap from file and use default one */
58 gboolean mc_args__nokeymap = FALSE;
60 char *mc_args__last_wd_file = NULL;
62 /* when enabled NETCODE, use following file as logfile */
63 char *mc_args__netfs_logfile = NULL;
65 /* keymap file */
66 char *mc_args__keymap_file = NULL;
68 void *mc_run_param0 = NULL;
69 char *mc_run_param1 = NULL;
71 /*** file scope macro definitions ****************************************************************/
73 /*** file scope type declarations ****************************************************************/
75 /*** forward declarations (file scope functions) *************************************************/
77 static gboolean parse_mc_e_argument (const gchar * option_name, const gchar * value,
78 gpointer data, GError ** mcerror);
79 static gboolean parse_mc_v_argument (const gchar * option_name, const gchar * value,
80 gpointer data, GError ** mcerror);
82 /*** file scope variables ************************************************************************/
84 /* If true, show version info and exit */
85 static gboolean mc_args__show_version = FALSE;
87 static GOptionContext *context;
89 #ifdef ENABLE_SUBSHELL
90 static gboolean mc_args__nouse_subshell = FALSE;
91 #endif /* ENABLE_SUBSHELL */
92 static gboolean mc_args__show_datadirs = FALSE;
93 static gboolean mc_args__show_datadirs_extended = FALSE;
94 #ifdef ENABLE_CONFIGURE_ARGS
95 static gboolean mc_args__show_configure_opts = FALSE;
96 #endif
98 static GOptionGroup *main_group;
100 static const GOptionEntry argument_main_table[] = {
101 /* *INDENT-OFF* */
102 /* generic options */
104 "version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
105 &mc_args__show_version,
106 N_("Displays the current version"),
107 NULL
110 /* options for wrappers */
112 "datadir", 'f', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
113 &mc_args__show_datadirs,
114 N_("Print data directory"),
115 NULL
118 /* show extended information about used data directories */
120 "datadir-info", 'F', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
121 &mc_args__show_datadirs_extended,
122 N_("Print extended info about used data directories"),
123 NULL
126 #ifdef ENABLE_CONFIGURE_ARGS
127 /* show configure options */
129 "configure-options", '\0', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
130 &mc_args__show_configure_opts,
131 N_("Print configure options"),
132 NULL
134 #endif
137 "printwd", 'P', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING,
138 &mc_args__last_wd_file,
139 N_("Print last working directory to specified file"),
140 N_("<file>")
143 #ifdef ENABLE_SUBSHELL
145 "subshell", 'U', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
146 &mc_global.tty.use_subshell,
147 N_("Enables subshell support (default)"),
148 NULL
152 "nosubshell", 'u', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
153 &mc_args__nouse_subshell,
154 N_("Disables subshell support"),
155 NULL
157 #endif
159 /* debug options */
160 #ifdef ENABLE_VFS_FTP
162 "ftplog", 'l', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING,
163 &mc_args__netfs_logfile,
164 N_("Log ftp dialog to specified file"),
165 N_("<file>")
167 #endif /* ENABLE_VFS_FTP */
170 /* handle arguments manually */
171 "view", 'v', G_OPTION_FLAG_IN_MAIN | G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
172 (gpointer) parse_mc_v_argument,
173 N_("Launches the file viewer on a file"),
174 N_("<file>")
178 /* handle arguments manually */
179 "edit", 'e', G_OPTION_FLAG_IN_MAIN | G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
180 (gpointer) parse_mc_e_argument,
181 N_("Edit files"),
182 N_("<file> ...")
185 G_OPTION_ENTRY_NULL
186 /* *INDENT-ON* */
189 static GOptionGroup *terminal_group;
190 #define ARGS_TERM_OPTIONS 0
191 static const GOptionEntry argument_terminal_table[] = {
192 /* *INDENT-OFF* */
193 /* terminal options */
195 "xterm", 'x', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
196 &mc_args__force_xterm,
197 N_("Forces xterm features"),
198 NULL
202 "no-x11", 'X', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
203 &mc_global.tty.disable_x11,
204 N_("Disable X11 support"),
205 NULL
209 "oldmouse", 'g', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
210 &mc_global.tty.old_mouse,
211 N_("Tries to use an old highlight mouse tracking"),
212 NULL
216 "nomouse", 'd', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
217 &mc_args__nomouse,
218 N_("Disable mouse support in text version"),
219 NULL
222 #ifdef HAVE_SLANG
224 "termcap", 't', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
225 &SLtt_Try_Termcap,
226 N_("Tries to use termcap instead of terminfo"),
227 NULL
229 #endif
232 "slow", 's', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
233 &mc_global.tty.slow_terminal,
234 N_("To run on slow terminals"),
235 NULL
239 "stickchars", 'a', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
240 &mc_global.tty.ugly_line_drawing,
241 N_("Use stickchars to draw"),
242 NULL
245 #ifdef HAVE_SLANG
247 "resetsoft", 'k', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
248 &reset_hp_softkeys,
249 N_("Resets soft keys on HP terminals"),
250 NULL
252 #endif
255 "keymap", 'K', ARGS_TERM_OPTIONS, G_OPTION_ARG_STRING,
256 &mc_args__keymap_file,
257 N_("Load definitions of key bindings from specified file"),
258 N_("<file>")
262 "nokeymap", '\0', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
263 &mc_args__nokeymap,
264 N_("Don't load definitions of key bindings from file, use defaults"),
265 NULL
268 G_OPTION_ENTRY_NULL
269 /* *INDENT-ON* */
272 #undef ARGS_TERM_OPTIONS
274 static GOptionGroup *color_group;
275 #define ARGS_COLOR_OPTIONS 0
276 /* #define ARGS_COLOR_OPTIONS G_OPTION_FLAG_IN_MAIN */
277 static const GOptionEntry argument_color_table[] = {
278 /* *INDENT-OFF* */
279 /* color options */
281 "nocolor", 'b', ARGS_COLOR_OPTIONS, G_OPTION_ARG_NONE,
282 &mc_global.tty.disable_colors,
283 N_("Requests to run in black and white"),
284 NULL
288 "color", 'c', ARGS_COLOR_OPTIONS, G_OPTION_ARG_NONE,
289 &mc_args__force_colors,
290 N_("Request to run in color mode"),
291 NULL
295 "colors", 'C', ARGS_COLOR_OPTIONS, G_OPTION_ARG_STRING,
296 &mc_global.tty.command_line_colors,
297 N_("Specifies a color configuration"),
298 N_("<string>")
302 "skin", 'S', ARGS_COLOR_OPTIONS, G_OPTION_ARG_STRING,
303 &mc_global.tty.skin,
304 N_("Show mc with specified skin"),
305 N_("<string>")
308 G_OPTION_ENTRY_NULL
309 /* *INDENT-ON* */
312 #undef ARGS_COLOR_OPTIONS
314 static gchar *mc_args__loc__colors_string = NULL;
315 static gchar *mc_args__loc__footer_string = NULL;
316 static gchar *mc_args__loc__header_string = NULL;
317 static gchar *mc_args__loc__usage_string = NULL;
319 /* --------------------------------------------------------------------------------------------- */
320 /*** file scope functions ************************************************************************/
321 /* --------------------------------------------------------------------------------------------- */
323 static void
324 mc_args_clean_temp_help_strings (void)
326 MC_PTR_FREE (mc_args__loc__colors_string);
327 MC_PTR_FREE (mc_args__loc__footer_string);
328 MC_PTR_FREE (mc_args__loc__header_string);
329 MC_PTR_FREE (mc_args__loc__usage_string);
332 /* --------------------------------------------------------------------------------------------- */
334 static GOptionGroup *
335 mc_args_new_color_group (void)
337 /* *INDENT-OFF* */
338 /* FIXME: to preserve translations, lines should be split. */
339 mc_args__loc__colors_string = g_strdup_printf ("%s\n%s",
340 /* TRANSLATORS: don't translate keywords */
341 _("--colors KEYWORD={FORE},{BACK},{ATTR}:KEYWORD2=...\n\n"
342 "{FORE}, {BACK} and {ATTR} can be omitted, and the default will be used\n"
343 "\n Keywords:\n"
344 " Global: errors, disabled, reverse, gauge, header\n"
345 " input, inputmark, inputunchanged, commandlinemark\n"
346 " bbarhotkey, bbarbutton, statusbar\n"
347 " File display: normal, selected, marked, markselect\n"
348 " Dialog boxes: dnormal, dfocus, dhotnormal, dhotfocus, errdhotnormal,\n"
349 " errdhotfocus\n"
350 " Menus: menunormal, menuhot, menusel, menuhotsel, menuinactive\n"
351 " Popup menus: pmenunormal, pmenusel, pmenutitle\n"
352 " Editor: editnormal, editbold, editmarked, editwhitespace, editnonprintable,\n"
353 " editlinestate, editbg, editframe, editframeactive\n"
354 " editframedrag\n"
355 " Viewer: viewnormal,viewbold, viewunderline, viewselected\n"
356 " Help: helpnormal, helpitalic, helpbold, helplink, helpslink\n"),
357 /* TRANSLATORS: don't translate color names and attributes */
358 _("Standard Colors:\n"
359 " black, gray, red, brightred, green, brightgreen, brown,\n"
360 " yellow, blue, brightblue, magenta, brightmagenta, cyan,\n"
361 " brightcyan, lightgray and white\n\n"
362 "Extended colors, when 256 colors are available:\n"
363 " color16 to color255, or rgb000 to rgb555 and gray0 to gray23\n\n"
364 "Attributes:\n"
365 " bold, italic, underline, reverse, blink; append more with '+'\n")
367 /* *INDENT-ON* */
369 return g_option_group_new ("color", mc_args__loc__colors_string,
370 _("Color options"), NULL, NULL);
374 /* --------------------------------------------------------------------------------------------- */
376 static gchar *
377 mc_args_add_usage_info (void)
379 gchar *s;
381 switch (mc_global.mc_run_mode)
383 #ifdef USE_INTERNAL_EDIT
384 case MC_RUN_EDITOR:
385 s = g_strdup_printf ("%s\n", _("[+lineno] file1[:lineno] [file2[:lineno]...]"));
386 break;
387 #endif /* USE_INTERNAL_EDIT */
388 case MC_RUN_VIEWER:
389 s = g_strdup_printf ("%s\n", _("file"));
390 break;
391 #ifdef USE_DIFF_VIEW
392 case MC_RUN_DIFFVIEWER:
393 s = g_strdup_printf ("%s\n", _("file1 file2"));
394 break;
395 #endif /* USE_DIFF_VIEW */
396 case MC_RUN_FULL:
397 default:
398 s = g_strdup_printf ("%s\n", _("[this_dir] [other_panel_dir]"));
401 mc_args__loc__usage_string = s;
403 return mc_args__loc__usage_string;
406 /* --------------------------------------------------------------------------------------------- */
408 static void
409 mc_args_add_extended_info_to_help (void)
411 mc_args__loc__footer_string = g_strdup_printf ("%s",
413 ("\n"
414 "Please send any bug reports (including the output of 'mc -V')\n"
415 "as tickets at www.midnight-commander.org\n"));
416 mc_args__loc__header_string =
417 g_strdup_printf (_("GNU Midnight Commander %s\n"), mc_global.mc_version);
419 g_option_context_set_description (context, mc_args__loc__footer_string);
420 g_option_context_set_summary (context, mc_args__loc__header_string);
423 /* --------------------------------------------------------------------------------------------- */
425 static GString *
426 mc_args__convert_help_to_syscharset (const gchar *charset, const gchar *error_message_str,
427 const gchar *help_str)
429 GString *buffer;
430 GIConv conv;
431 gchar *full_help_str;
433 buffer = g_string_new ("");
434 conv = g_iconv_open (charset, "UTF-8");
435 full_help_str = g_strdup_printf ("%s\n\n%s\n", error_message_str, help_str);
437 str_convert (conv, full_help_str, buffer);
439 g_free (full_help_str);
440 g_iconv_close (conv);
442 return buffer;
445 /* --------------------------------------------------------------------------------------------- */
447 static gboolean
448 parse_mc_e_argument (const gchar *option_name, const gchar *value, gpointer data, GError **mcerror)
450 (void) option_name;
451 (void) value;
452 (void) data;
454 mc_return_val_if_error (mcerror, FALSE);
456 mc_global.mc_run_mode = MC_RUN_EDITOR;
458 return TRUE;
461 /* --------------------------------------------------------------------------------------------- */
463 static gboolean
464 parse_mc_v_argument (const gchar *option_name, const gchar *value, gpointer data, GError **mcerror)
466 (void) option_name;
467 (void) value;
468 (void) data;
470 mc_return_val_if_error (mcerror, FALSE);
472 mc_global.mc_run_mode = MC_RUN_VIEWER;
474 return TRUE;
477 /* --------------------------------------------------------------------------------------------- */
479 #ifdef USE_INTERNAL_EDIT
481 * Get list of filenames (and line numbers) from command line, when mc called as editor
483 * @param argc count of all arguments
484 * @param argv array of strings, contains arguments
485 * @return list of edit_arg_t objects
488 static GList *
489 parse_mcedit_arguments (int argc, char **argv)
491 GList *flist = NULL;
492 int i;
493 long first_line_number = -1;
495 for (i = 0; i < argc; i++)
497 char *tmp;
498 char *end, *p;
499 edit_arg_t *arg;
501 tmp = argv[i];
504 * First, try to get line number as +lineno.
506 if (*tmp == '+')
508 long lineno;
509 char *error;
511 lineno = strtol (tmp + 1, &error, 10);
513 if (*error == '\0')
515 /* this is line number */
516 first_line_number = lineno;
517 continue;
519 /* this is file name */
523 * Check for filename:lineno, followed by an optional colon.
524 * This format is used by many programs (especially compilers)
525 * in error messages and warnings. It is supported so that
526 * users can quickly copy and paste file locations.
528 end = tmp + strlen (tmp);
529 p = end;
531 if (p > tmp && p[-1] == ':')
532 p--;
533 while (p > tmp && g_ascii_isdigit ((gchar) p[-1]))
534 p--;
536 if (tmp < p && p < end && p[-1] == ':')
538 char *fname;
539 vfs_path_t *tmp_vpath, *fname_vpath;
540 struct stat st;
542 fname = g_strndup (tmp, p - 1 - tmp);
543 tmp_vpath = vfs_path_from_str (tmp);
544 fname_vpath = vfs_path_from_str (fname);
547 * Check that the file before the colon actually exists.
548 * If it doesn't exist, create new file.
550 if (mc_stat (tmp_vpath, &st) == -1 && mc_stat (fname_vpath, &st) != -1)
552 arg = edit_arg_vpath_new (fname_vpath, atoi (p));
553 vfs_path_free (tmp_vpath, TRUE);
555 else
557 arg = edit_arg_vpath_new (tmp_vpath, 0);
558 vfs_path_free (fname_vpath, TRUE);
561 g_free (fname);
563 else
564 arg = edit_arg_new (tmp, 0);
566 flist = g_list_prepend (flist, arg);
569 if (flist == NULL)
570 flist = g_list_prepend (flist, edit_arg_new (NULL, 0));
571 else if (first_line_number != -1)
573 /* overwrite line number for first file */
574 GList *l;
576 l = g_list_last (flist);
577 ((edit_arg_t *) l->data)->line_number = first_line_number;
580 return flist;
582 #endif /* USE_INTERNAL_EDIT */
584 /* --------------------------------------------------------------------------------------------- */
585 /*** public functions ****************************************************************************/
586 /* --------------------------------------------------------------------------------------------- */
588 void
589 mc_setup_run_mode (char **argv)
591 const char *base;
593 base = x_basename (argv[0]);
595 if (strncmp (base, "mcv", 3) == 0 || strcmp (base, "view") == 0)
597 /* mcv* or view is link to mc */
598 mc_global.mc_run_mode = MC_RUN_VIEWER;
600 #ifdef USE_INTERNAL_EDIT
601 else if (strncmp (base, "mce", 3) == 0 || strcmp (base, "vi") == 0)
603 /* mce* or vi is link to mc */
604 mc_global.mc_run_mode = MC_RUN_EDITOR;
606 #endif
607 #ifdef USE_DIFF_VIEW
608 else if (strncmp (base, "mcd", 3) == 0 || strcmp (base, "diff") == 0)
610 /* mcd* or diff is link to mc */
611 mc_global.mc_run_mode = MC_RUN_DIFFVIEWER;
613 #endif /* USE_DIFF_VIEW */
616 /* --------------------------------------------------------------------------------------------- */
618 gboolean
619 mc_args_parse (int *argc, char ***argv, const char *translation_domain, GError **mcerror)
621 const gchar *_system_codepage;
622 gboolean ok = TRUE;
624 mc_return_val_if_error (mcerror, FALSE);
626 _system_codepage = str_detect_termencoding ();
628 #ifdef ENABLE_NLS
629 if (!str_isutf8 (_system_codepage))
630 bind_textdomain_codeset ("mc", "UTF-8");
631 #endif
633 context = g_option_context_new (mc_args_add_usage_info ());
635 g_option_context_set_ignore_unknown_options (context, FALSE);
637 mc_args_add_extended_info_to_help ();
639 main_group = g_option_group_new ("main", _("Main options"), _("Main options"), NULL, NULL);
641 g_option_group_add_entries (main_group, argument_main_table);
642 g_option_context_set_main_group (context, main_group);
643 g_option_group_set_translation_domain (main_group, translation_domain);
645 terminal_group = g_option_group_new ("terminal", _("Terminal options"),
646 _("Terminal options"), NULL, NULL);
648 g_option_group_add_entries (terminal_group, argument_terminal_table);
649 g_option_context_add_group (context, terminal_group);
650 g_option_group_set_translation_domain (terminal_group, translation_domain);
652 color_group = mc_args_new_color_group ();
654 g_option_group_add_entries (color_group, argument_color_table);
655 g_option_context_add_group (context, color_group);
656 g_option_group_set_translation_domain (color_group, translation_domain);
658 if (!g_option_context_parse (context, argc, argv, mcerror))
660 if (*mcerror == NULL)
661 mc_propagate_error (mcerror, 0, "%s\n", _("Arguments parse error!"));
662 else
664 gchar *help_str;
666 help_str = g_option_context_get_help (context, TRUE, NULL);
668 if (str_isutf8 (_system_codepage))
669 mc_replace_error (mcerror, (*mcerror)->code, "%s\n\n%s\n", (*mcerror)->message,
670 help_str);
671 else
673 GString *full_help_str;
675 full_help_str =
676 mc_args__convert_help_to_syscharset (_system_codepage, (*mcerror)->message,
677 help_str);
678 mc_replace_error (mcerror, (*mcerror)->code, "%s", full_help_str->str);
679 g_string_free (full_help_str, TRUE);
681 g_free (help_str);
684 ok = FALSE;
687 g_option_context_free (context);
688 mc_args_clean_temp_help_strings ();
690 #ifdef ENABLE_NLS
691 if (!str_isutf8 (_system_codepage))
692 bind_textdomain_codeset ("mc", _system_codepage);
693 #endif
695 return ok;
698 /* --------------------------------------------------------------------------------------------- */
700 gboolean
701 mc_args_show_info (void)
703 if (mc_args__show_version)
705 show_version ();
706 return FALSE;
709 if (mc_args__show_datadirs)
711 printf ("%s (%s)\n", mc_global.sysconfig_dir, mc_global.share_data_dir);
712 return FALSE;
715 if (mc_args__show_datadirs_extended)
717 show_datadirs_extended ();
718 return FALSE;
721 #ifdef ENABLE_CONFIGURE_ARGS
722 if (mc_args__show_configure_opts)
724 show_configure_options ();
725 return FALSE;
727 #endif
729 return TRUE;
732 /* --------------------------------------------------------------------------------------------- */
734 gboolean
735 mc_setup_by_args (int argc, char **argv, GError **mcerror)
737 char *tmp;
739 mc_return_val_if_error (mcerror, FALSE);
741 if (mc_args__force_colors)
742 mc_global.tty.disable_colors = FALSE;
744 #ifdef ENABLE_SUBSHELL
745 if (mc_args__nouse_subshell)
746 mc_global.tty.use_subshell = FALSE;
747 #endif /* ENABLE_SUBSHELL */
749 #ifdef ENABLE_VFS_FTP
750 if (mc_args__netfs_logfile != NULL)
752 vfs_path_t *vpath;
754 vpath = vfs_path_from_str ("ftp://");
755 mc_setctl (vpath, VFS_SETCTL_LOGFILE, (void *) mc_args__netfs_logfile);
756 vfs_path_free (vpath, TRUE);
758 #endif /* ENABLE_VFS_FTP */
760 tmp = (argc > 0) ? argv[1] : NULL;
762 switch (mc_global.mc_run_mode)
764 case MC_RUN_EDITOR:
765 #ifdef USE_INTERNAL_EDIT
766 mc_run_param0 = parse_mcedit_arguments (argc - 1, &argv[1]);
767 break;
768 #else
769 mc_propagate_error (mcerror, 0, "%s\n", _("MC is built without builtin editor."));
770 return FALSE;
771 #endif
773 case MC_RUN_VIEWER:
774 if (tmp == NULL)
776 mc_propagate_error (mcerror, 0, "%s\n", _("No arguments given to the viewer."));
777 return FALSE;
780 mc_run_param0 = g_strdup (tmp);
781 break;
783 #ifdef USE_DIFF_VIEW
784 case MC_RUN_DIFFVIEWER:
785 if (argc < 3)
787 mc_propagate_error (mcerror, 0, "%s\n",
788 _("Two files are required to invoke the diffviewer."));
789 return FALSE;
791 MC_FALLTHROUGH;
792 #endif /* USE_DIFF_VIEW */
794 case MC_RUN_FULL:
795 default:
796 /* set the current dir and the other dir for filemanager,
797 or two files for diff viewer */
798 if (tmp != NULL)
800 mc_run_param0 = g_strdup (tmp);
801 tmp = (argc > 1) ? argv[2] : NULL;
802 if (tmp != NULL)
803 mc_run_param1 = g_strdup (tmp);
805 break;
808 return TRUE;
811 /* --------------------------------------------------------------------------------------------- */