[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/info info.c,1.2,1.3
From: |
dirt |
Subject: |
texinfo/info info.c,1.2,1.3 |
Date: |
Sat, 17 Jan 2004 13:19:30 +0100 |
Update of /cvsroot/texinfo/texinfo/info
In directory sheep:/tmp/cvs-serv28669/info
Modified Files:
info.c
Log Message:
2004-01-17 Alper Ersoy <address@hidden>
* info/info.c (main, info_short_help): new option -w, --where,
--location that prints the physical location of Info file.
Index: info.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/info/info.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** info.c 9 Jan 2004 09:07:44 -0000 1.2
--- info.c 17 Jan 2004 12:19:27 -0000 1.3
***************
*** 2,7 ****
$Id$
! Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
! Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
--- 2,7 ----
$Id$
! Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
! 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
***************
*** 81,84 ****
--- 81,87 ----
int raw_escapes_p = 1;
+ /* Non-zero means print the absolute location of the file to be loaded. */
+ static int print_where_p = 0;
+
#ifdef __MSDOS__
/* Non-zero indicates that screen output should be made 'speech-friendly'.
***************
*** 104,107 ****
--- 107,111 ----
{ "help", 0, &print_help_p, 1 },
{ "index-search", 1, 0, IDXSRCH_OPTION },
+ { "location", 0, &print_where_p, 1 },
{ "node", 1, 0, 'n' },
{ "output", 1, 0, 'o' },
***************
*** 114,117 ****
--- 118,122 ----
{ "version", 0, &print_version_p, 1 },
{ "vi-keys", 0, &vi_keys_p, 1 },
+ { "where", 0, &print_where_p, 1 },
#ifdef __MSDOS__
{ "speech-friendly", 0, &speech_friendly, 1 },
***************
*** 122,128 ****
/* String describing the shorthand versions of the long options found above.
*/
#ifdef __MSDOS__
! static char *short_options = "d:n:f:ho:ORsb";
#else
! static char *short_options = "d:n:f:ho:ORs";
#endif
--- 127,133 ----
/* String describing the shorthand versions of the long options found above.
*/
#ifdef __MSDOS__
! static char *short_options = "d:n:f:ho:ORswb";
#else
! static char *short_options = "d:n:f:ho:ORws";
#endif
***************
*** 231,234 ****
--- 236,244 ----
break;
+ /* For compatibility with man, -w is --where. */
+ case 'w':
+ print_where_p = 1;
+ break;
+
#ifdef __MSDOS__
/* User wants speech-friendly output. */
***************
*** 287,291 ****
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
! "2003");
xexit (0);
}
--- 297,301 ----
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
! "2004");
xexit (0);
}
***************
*** 372,376 ****
free (initial_node);
! if (user_output_filename)
dump_nodes_to_file
(user_filename, user_nodenames, user_output_filename,
dump_subnodes);
--- 382,388 ----
free (initial_node);
! if (print_where_p)
! printf ("%s\n", user_filename);
! else if (user_output_filename)
dump_nodes_to_file
(user_filename, user_nodenames, user_output_filename,
dump_subnodes);
***************
*** 393,396 ****
--- 405,419 ----
initial_node = new_initial_node;
+ if (print_where_p)
+ {
+ if (initial_node->parent)
+ printf ("%s\n", initial_node->parent);
+ else if (initial_node->filename)
+ printf ("%s\n", initial_node->filename);
+ else
+ xexit (1);
+ xexit (0);
+ }
+
/* If the user specified that this node should be output, then do that
now. Otherwise, start the Info session with this node. Or act
***************
*** 593,596 ****
--- 616,620 ----
-O, --show-options, --usage go to command-line options node.\n%s\
--subnodes recursively output menu items.\n\
+ -w, --where, --location print physical location of Info file.\n\
--vi-keys use vi-like and less-like key bindings.\n\
--version display version information and exit.\n\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/info info.c,1.2,1.3,
dirt <=