Re: cygutils - mkshortcut - Patch for --desc option for description/tooltip text - Needed for new Cygwin/X package

2004-03-12 Thread Charles Wilson
Joshua Daniel Franklin wrote:
Looks good to me. I'd rather the --help output be kept under 80 chars,
but it's already too late for the --workingdir option too. Oh well.
okay...

Before you release another cygutils package, note that 'readlink' may
conflict with the proposed coreutils. Might be a good opportunity for
coordination.
Sure -- but I'm not going to delay cygutils-1.2.5 waiting for coreutils 
to finish shaking down.  If I need to release cygutils-1.2.6 next week, 
I'll do so.

--
Chuck


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: cygutils - mkshortcut - Patch for --desc option for description/tooltip text - Needed for new Cygwin/X package

2004-03-11 Thread Joshua Daniel Franklin
On Thu, Mar 11, 2004 at 01:13:48AM -0500, Charles Wilson wrote:
 Igor Pechtchanski wrote:
  On Wed, 10 Mar 2004, Harold L Hunt II wrote:
  
  Attached is a patch to mkshortcut to allow it to take a [-d|--desc] DESC
  option that specifies the text of the description (tooltip text) for the
  shortcut.  If -d|--desc is not specified, then the previous behavior of
  setting the description to the POSIX path to the application is used.
 
  I have build tested and run tested the attached patch.
 
  I need this patch for a replacement for the XFree86-bin-icons package.
  I already have the new package in hand, but I need this new
  functionality in order for the shortcuts to have meaningful names and
  descriptions.
 
 I'll let Joshua make the call on this; if he says go then I'll put it 
 in and release a new cygutils as quickly as I can.

Looks good to me. I'd rather the --help output be kept under 80 chars,
but it's already too late for the --workingdir option too. Oh well.


Before you release another cygutils package, note that 'readlink' may
conflict with the proposed coreutils. Might be a good opportunity for
coordination.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



cygutils - mkshortcut - Patch for --desc option for description/tooltip text - Needed for new Cygwin/X package

2004-03-10 Thread Harold L Hunt II
Attached is a patch to mkshortcut to allow it to take a [-d|--desc] DESC 
option that specifies the text of the description (tooltip text) for the 
shortcut.  If -d|--desc is not specified, then the previous behavior of 
setting the description to the POSIX path to the application is used.

I have build tested and run tested the attached patch.

I need this patch for a replacement for the XFree86-bin-icons package. 
I already have the new package in hand, but I need this new 
functionality in order for the shortcuts to have meaningful names and 
descriptions.

Harold
Index: mkshortcut/mkshortcut.1
===
RCS file: /cvs/cygwin-apps/cygutils/src/mkshortcut/mkshortcut.1,v
retrieving revision 1.5
diff -u -r1.5 mkshortcut.1
--- mkshortcut/mkshortcut.1 14 Feb 2004 23:34:57 -  1.5
+++ mkshortcut/mkshortcut.1 10 Mar 2004 18:43:03 -
@@ -1,6 +1,6 @@
 .\{{{}}}
 .\{{{  Title
-.TH MKSHORTCUT 1 21 Oct 03 mkshortcut 1.5 (cygutils) Cygutils
+.TH MKSHORTCUT 1 10 Mar 04 mkshortcut 1.6 (cygutils) Cygutils
 .\}}}
 .\{{{  Name
 .SH NAME
@@ -10,7 +10,8 @@
 .SH SYNOPSIS
 .B mkshorcut
 .RB [\-\fBa\fP \fIARGS\fP]
-.RB [\-\fBi\fP \fIiconfile\fP [\-\fBj\fP \fIINT\fP] ]
+.RB [\-\fBd\fP \fIDESC\fP]
+.RB [\-\fBi\fP \fIICONFILE\fP [\-\fBj\fP \fIINT\fP] ]
 .RB [\-\fBn\fP \fINAME\fP ]
 .RB [\-\fBs\fP \fInorm|min|max\fP ]
 .RB [\-\fBw\fP \fIPATH\fP ]
@@ -23,6 +24,10 @@
 .TP 
 \fB\-a\fR, \fB\-\-arguments\fP=\fIARGS\fP
 Arguments to use (see example below).
+
+.TP 
+\fB\-d\fR, \fB\-\-desc\fR=\fIDESC\fP
+Text for description/tooltip (defaults to POSIX path of TARGET). Note that 
\fIDESC\fP can contain spaces, but in that case must be enclosed in quotes.
 
 .TP 
 \fB\-h\fR, \fB\-\-help\fR
Index: mkshortcut/mkshortcut.c
===
RCS file: /cvs/cygwin-apps/cygutils/src/mkshortcut/mkshortcut.c,v
retrieving revision 1.6
diff -u -r1.6 mkshortcut.c
--- mkshortcut/mkshortcut.c 14 Feb 2004 23:34:57 -  1.6
+++ mkshortcut/mkshortcut.c 10 Mar 2004 18:43:03 -
@@ -61,6 +61,7 @@
   int show_flag;
   int offset;
   char * name_arg;
+  char * desc_arg;
   char * dir_name_arg;
   char * argument_arg;
   char * target_arg;
@@ -93,7 +94,7 @@
   const char * arg;
 
   struct poptOption helpOptionsTable[] = {
-{ help,  'h',  POPT_ARG_NONE, NULL, '?', \
+{ help, 'h',  POPT_ARG_NONE, NULL, '?', \
 Show this help message, NULL},
 { usage, '\0', POPT_ARG_NONE, NULL, 'u', \
 Display brief usage message, NULL},
@@ -105,24 +106,26 @@
   };
 
   struct poptOption generalOptionsTable[] = {
-{ arguments,  'a',  POPT_ARG_STRING, NULL, 'a', \
+{ arguments, 'a',  POPT_ARG_STRING, NULL, 'a', \
 Use arguments ARGS, ARGS},
+{ desc, 'd', POPT_ARG_STRING, NULL, 'd', \
+Text for description/tooltip (defaults to POSIX path of TARGET), DESC},
 { icon, 'i', POPT_ARG_STRING, NULL, 'i', \
-icon file for link to use, iconfile},
+Icon file for link to use, ICONFILE},
 { iconoffset, 'j', POPT_ARG_INT, (opts.offset), 'j', \
-offset of icon in icon file (default is 0), NULL},
+Offset of icon in icon file (default is 0), NULL},
 { name, 'n', POPT_ARG_STRING, NULL, 'n', \
-name for link (defaults to TARGET), NAME},
+Name for link (defaults to TARGET), NAME},
 { show, 's', POPT_ARG_STRING, NULL, 's', \
-window to show: normal, minimized, maximized, norm|min|max},
+Window to show: normal, minimized, maximized, norm|min|max},
 { workingdir, 'w', POPT_ARG_STRING, NULL, 'w', \
-set working directory (defaults to directory path of TARGET), PATH},
+Set working directory (defaults to directory path of TARGET), PATH},
 { allusers, 'A', POPT_ARG_VAL, (opts.allusers_flag), 1, \
-use 'All Users' instead of current user for -D,-P, NULL},
+Use 'All Users' instead of current user for -D,-P, NULL},
 { desktop, 'D', POPT_ARG_VAL, (opts.desktop_flag), 1, \
-create link relative to 'Desktop' directory, NULL},
+Create link relative to 'Desktop' directory, NULL},
 { smprograms, 'P', POPT_ARG_VAL, (opts.smprograms_flag), 1, \
-create link relative to Start Menu 'Programs' directory, NULL},
+Create link relative to Start Menu 'Programs' directory, NULL},
 { NULL, '\0', 0, NULL, 0, NULL, NULL }
   };
   
@@ -161,6 +164,7 @@
   opts.target_arg = NULL;
   opts.argument_arg = NULL;
   opts.name_arg = NULL;
+  opts.desc_arg = NULL;
   opts.dir_name_arg = NULL;
   opts.icon_name_arg = NULL;
 
@@ -177,6 +181,14 @@
  goto exit;
   case 'l':  license(optCon, stderr, program_name);
  goto exit;
+  case 'd':  if (arg = poptGetOptArg(optCon)) {
+   if ((opts.desc_arg = strdup(arg)) == NULL ) {
+ fprintf(stderr, %s: memory allocation error\n, program_name);
+ 

Re: cygutils - mkshortcut - Patch for --desc option for description/tooltip text - Needed for new Cygwin/X package

2004-03-10 Thread Igor Pechtchanski
On Wed, 10 Mar 2004, Harold L Hunt II wrote:

Attached is a patch to mkshortcut to allow it to take a [-d|--desc] DESC
option that specifies the text of the description (tooltip text) for the
shortcut.  If -d|--desc is not specified, then the previous behavior of
setting the description to the POSIX path to the application is used.
I have build tested and run tested the attached patch.

I need this patch for a replacement for the XFree86-bin-icons package.
I already have the new package in hand, but I need this new
functionality in order for the shortcuts to have meaningful names and
descriptions.
Harold
Umm, don't the symbolic links in Cygwin use the description field for the
link contents?  Also, why was this sent to cygwin-apps -- doesn't it fit
better with the main Cygwin list?
Igor
--
http://cs.nyu.edu/~pechtcha/
 |\  _,,,---,,_ [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
|,4-  ) )-,_. ,\ (  `'-'Igor Pechtchanski, Ph.D.
   '---''(_/--'  `-'\_) fL  a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster.  -- Patrick Naughton


Re: cygutils - mkshortcut - Patch for --desc option for description/tooltip text - Needed for new Cygwin/X package

2004-03-10 Thread Charles Wilson
Igor Pechtchanski wrote:
On Wed, 10 Mar 2004, Harold L Hunt II wrote:

Attached is a patch to mkshortcut to allow it to take a [-d|--desc] DESC
option that specifies the text of the description (tooltip text) for the
shortcut.  If -d|--desc is not specified, then the previous behavior of
setting the description to the POSIX path to the application is used.
I have build tested and run tested the attached patch.

I need this patch for a replacement for the XFree86-bin-icons package.
I already have the new package in hand, but I need this new
functionality in order for the shortcuts to have meaningful names and
descriptions.
I'll let Joshua make the call on this; if he says go then I'll put it 
in and release a new cygutils as quickly as I can.

Umm, don't the symbolic links in Cygwin use the description field for the
link contents? 
Perhaps, but it doesn't matter.  mkshortcut is for creating 
Windows-style shortcuts.  And Windows-style shortcuts put descriptions 
in the desc field.

--
Chuck
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/