mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 01:54:24 +03:00
Merge branch '2495_show_addition_info_about_paths'
* 2495_show_addition_info_about_paths: Describe new command line options (-F and --configure-options) in English and Russian man pages. Added --configure-options for easy update & reconfigure existing mc. Ticket #2495 (addition info about paths)
This commit is contained in:
commit
e4c064120b
@ -25,6 +25,8 @@ AC_CANONICAL_HOST
|
||||
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS],["$ac_configure_args"],[MC configure arguments])
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
PKG_PROG_PKG_CONFIG
|
||||
AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
|
||||
|
@ -55,6 +55,13 @@ startup. See also
|
||||
.I \-f, \-\-datadir
|
||||
Display the compiled\-in search paths for Midnight Commander files.
|
||||
.TP
|
||||
.I \-F, \-\-datadir\-info
|
||||
Display extended info about compiled\-in paths for
|
||||
Midnight Commander.
|
||||
.TP
|
||||
.I \-\-configure\-options
|
||||
Display configure options.
|
||||
.TP
|
||||
.I \-k, \-\-resetsoft
|
||||
Reset softkeys to their default from the termcap/terminfo
|
||||
database. Only useful on HP terminals when the function keys don't work.
|
||||
|
@ -62,10 +62,17 @@ UNIX\-подобных операционных системах.
|
||||
будет открыт при старте. Смотрите также
|
||||
.BR mcedit(1) .
|
||||
.TP
|
||||
.I \-f
|
||||
.I \-f, \-\-datadir
|
||||
Выводит на экран определенный в процессе компиляции программы путь к
|
||||
файлам программы Midnight Commander.
|
||||
.TP
|
||||
.I \-F, \-\-datadir\-info
|
||||
Выводит на экран расширенную информацию о путях, используемых при работе
|
||||
программы Midnight Commander.
|
||||
.TP
|
||||
.I \-\-configure\-options
|
||||
Выводит опции конфигурирования, с которыми был собран Midnight Commander.
|
||||
.TP
|
||||
.I \-k
|
||||
Восстанавливает значения команд, назначенных функциональным клавишам в
|
||||
предусмотренные по умолчанию значения, используя базу данных
|
||||
|
30
src/args.c
30
src/args.c
@ -92,6 +92,8 @@ static GOptionContext *context;
|
||||
|
||||
static gboolean mc_args__nouse_subshell = FALSE;
|
||||
static gboolean mc_args__show_datadirs = FALSE;
|
||||
static gboolean mc_args__show_datadirs_extended = FALSE;
|
||||
static gboolean mc_args__show_configure_opts = FALSE;
|
||||
|
||||
static GOptionGroup *main_group;
|
||||
|
||||
@ -113,6 +115,22 @@ static const GOptionEntry argument_main_table[] = {
|
||||
NULL
|
||||
},
|
||||
|
||||
/* show extended information about used data directories */
|
||||
{
|
||||
"datadir-info", 'F', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
|
||||
&mc_args__show_datadirs_extended,
|
||||
N_("Print extended info about used data directories"),
|
||||
NULL
|
||||
},
|
||||
|
||||
/* show configure options */
|
||||
{
|
||||
"configure-options", '\0', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
|
||||
&mc_args__show_configure_opts,
|
||||
N_("Print configure options"),
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
"printwd", 'P', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING,
|
||||
&mc_args__last_wd_file,
|
||||
@ -570,6 +588,18 @@ mc_args_process (int argc, char *argv[])
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mc_args__show_datadirs_extended)
|
||||
{
|
||||
show_datadirs_extended ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mc_args__show_configure_opts)
|
||||
{
|
||||
show_configure_options ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mc_args__force_colors)
|
||||
mc_global.args.disable_colors = FALSE;
|
||||
|
||||
|
@ -29,6 +29,9 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/mcconfig.h"
|
||||
|
||||
#include "src/textconf.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
@ -158,3 +161,57 @@ show_version (void)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
#define PRINTF_GROUP(a) \
|
||||
(void) printf ("[%s]\n", a)
|
||||
#define PRINTF_SECTION(a,b) \
|
||||
(void) printf (" %-17s %s\n", a, b)
|
||||
#define PRINTF_SECTION2(a,b) \
|
||||
(void) printf (" %-17s %s/\n", a, b)
|
||||
#define PRINTF(a, b, c) \
|
||||
(void) printf ("\t%-15s %s/%s\n", a, b, c)
|
||||
#define PRINTF2(a, b, c) \
|
||||
(void) printf ("\t%-15s %s%s\n", a, b, c)
|
||||
|
||||
void
|
||||
show_datadirs_extended (void)
|
||||
{
|
||||
PRINTF_GROUP (_("System data"));
|
||||
|
||||
PRINTF_SECTION ( _("Config directory:"), mc_global.sysconfig_dir);
|
||||
PRINTF_SECTION (_("Data directory:"), mc_global.share_data_dir);
|
||||
#ifdef ENABLE_VFS_EXTFS
|
||||
PRINTF2 ("extfs.d:", mc_global.share_data_dir, MC_EXTFS_DIR"/");
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
PRINTF2 ("fish:", mc_global.share_data_dir, FISH_PREFIX"/");
|
||||
#endif
|
||||
(void) puts ("");
|
||||
|
||||
PRINTF_GROUP (_("User data"));
|
||||
|
||||
PRINTF_SECTION2 ( _("Config directory:"), mc_config_get_path ());
|
||||
PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
|
||||
PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_SUBDIR"/");
|
||||
#ifdef ENABLE_VFS_EXTFS
|
||||
PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR"/");
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX"/");
|
||||
#endif
|
||||
|
||||
PRINTF_SECTION2 ( _("Cache directory:"), mc_config_get_cache_path ());
|
||||
|
||||
}
|
||||
#undef PRINTF
|
||||
#undef PRINTF_SECTION
|
||||
#undef PRINTF_GROUP
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
show_configure_options (void)
|
||||
{
|
||||
(void) printf ("%s\n", MC_CONFIGURE_ARGS);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -16,6 +16,8 @@
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
extern void show_version (void);
|
||||
extern void show_datadirs_extended (void);
|
||||
extern void show_configure_options (void);
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
#endif /* MC__TEXTCONF_H */
|
||||
|
Loading…
Reference in New Issue
Block a user