|
@@ -39,12 +39,8 @@
|
|
|
/* VTY shell program name. */
|
|
|
char *progname;
|
|
|
|
|
|
-/* Configuration file name. Usually this is configurable, but vtysh
|
|
|
- * has static configuration file only. */
|
|
|
+/* Configuration file name and directory. */
|
|
|
char *config_file = NULL;
|
|
|
-
|
|
|
-/* Configuration file and directory. */
|
|
|
-char *config_current = NULL;
|
|
|
char config_default[] = SYSCONFDIR VTYSH_DEFAULT_CONFIG;
|
|
|
|
|
|
/* Integrated configuration file. */
|
|
@@ -146,6 +142,7 @@ usage (int status)
|
|
|
"Integrated shell for Quagga routing software suite. \n\n"\
|
|
|
"-b, --boot Execute boot startup configuration\n" \
|
|
|
"-c, --command Execute argument as command\n "\
|
|
|
+ "-f, --config_file Set configuration file name\n"\
|
|
|
"-h, --help Display this help and exit\n\n" \
|
|
|
"Report bugs to %s\n", progname, ZEBRA_BUG_ADDRESS);
|
|
|
|
|
@@ -160,6 +157,7 @@ struct option longopts[] =
|
|
|
{ "eval", required_argument, NULL, 'e'},
|
|
|
{ "command", required_argument, NULL, 'c'},
|
|
|
{ "help", no_argument, NULL, 'h'},
|
|
|
+ { "config_file", required_argument, NULL, 'f'},
|
|
|
{ 0 }
|
|
|
};
|
|
|
|
|
@@ -209,7 +207,7 @@ main (int argc, char **argv, char **env)
|
|
|
/* Option handling. */
|
|
|
while (1)
|
|
|
{
|
|
|
- opt = getopt_long (argc, argv, "be:c:h", longopts, 0);
|
|
|
+ opt = getopt_long (argc, argv, "be:c:hf:", longopts, 0);
|
|
|
|
|
|
if (opt == EOF)
|
|
|
break;
|
|
@@ -229,8 +227,12 @@ main (int argc, char **argv, char **env)
|
|
|
case 'h':
|
|
|
usage (0);
|
|
|
break;
|
|
|
+ /* XXX It isn't used in any way. */
|
|
|
case 'i':
|
|
|
integrated_file = strdup (optarg);
|
|
|
+ case 'f':
|
|
|
+ config_file = optarg;
|
|
|
+ break;
|
|
|
default:
|
|
|
usage (1);
|
|
|
break;
|
|
@@ -256,7 +258,7 @@ main (int argc, char **argv, char **env)
|
|
|
vtysh_connect_all ();
|
|
|
|
|
|
/* Read vtysh configuration file. */
|
|
|
- vtysh_read_config (config_file, config_current, config_default);
|
|
|
+ vtysh_read_config (config_file, config_default);
|
|
|
|
|
|
/* If eval mode. */
|
|
|
if (eval_flag)
|
|
@@ -268,7 +270,7 @@ main (int argc, char **argv, char **env)
|
|
|
/* Boot startup configuration file. */
|
|
|
if (boot_flag)
|
|
|
{
|
|
|
- vtysh_read_config (integrate_file, integrate_current, integrate_default);
|
|
|
+ vtysh_read_config (integrate_file, integrate_default);
|
|
|
exit (0);
|
|
|
}
|
|
|
|