[hackers] [st] This changes -f to be the parameter for the font. Now -f is -o. || Christoph Lohmann

From: <hg_AT_suckless.org>
Date: Sun, 30 Sep 2012 20:25:41 +0200 (CEST)

changeset: 343:28d9857fc263
tag: tip
user: Christoph Lohmann <20h_AT_r-36.net>
date: Sun Sep 30 20:23:10 2012 +0200
files: st.1 st.c
description:
This changes -f to be the parameter for the font. Now -f is -o.
The parameters were reordered according to the alphabet too.


diff -r 12d23b72ffb0 -r 28d9857fc263 st.1
--- a/st.1 Sun Sep 30 20:10:58 2012 +0200
+++ b/st.1 Sun Sep 30 20:23:10 2012 +0200
_AT_@ -5,15 +5,17 @@
 .B st
 .RB [ \-c
 .IR class ]
+.RB [ \-f
+.IR font ]
 .RB [ \-g
 .IR geometry ]
+.RB [ \-o
+.IR file ]
 .RB [ \-t
 .IR title ]
 .RB [ \-w
 .IR windowid ]
 .RB [ \-v ]
-.RB [ \-f
-.IR file ]
 .RB [ \-e
 .IR command ...]
 .SH DESCRIPTION
_AT_@ -21,26 +23,33 @@
 is a simple terminal emulator.
 .SH OPTIONS
 .TP
+.BI \-c " class"
+defines the window class (default $TERM).
+.TP
+.BI \-f " font"
+defines the
+.I font
+to use when st is run.
+.TP
+.BI \-g " geometry"
+defines the X11 geometry string, which will fixate the height and width of st.
+.TP
+.BI \-o " file"
+writes all the I/O to
+.I file.
+This feature is useful when recording st sessions. A value of "-" means
+standard output.
+.TP
 .BI \-t " title"
 defines the window title (default 'st').
 .TP
-.BI \-c " class"
-defines the window class (default $TERM).
-.TP
 .BI \-w " windowid"
 embeds st within the window identified by
 .I windowid
 .TP
-.B \-g " geometry"
-defines the X11 geometry string, which will fixate the height and width of st.
 .B \-v
 prints version information to stderr, then exits.
 .TP
-.BI \-f " file"
-writes all the I/O to
-.I file.
-This feature is useful when recording st sessions.
-.TP
 .BI \-e " program " [ " arguments " "... ]"
 st executes
 .I program
diff -r 12d23b72ffb0 -r 28d9857fc263 st.c
--- a/st.c Sun Sep 30 20:10:58 2012 +0200
+++ b/st.c Sun Sep 30 20:23:10 2012 +0200
_AT_@ -39,8 +39,8 @@
 
 #define USAGE \
         "st " VERSION " (c) 2010-2012 st engineers\n" \
- "usage: st [-t title] [-c class] [-g geometry]" \
- " [-w windowid] [-v] [-f file] [-e command...]\n"
+ "usage: st [-v] [-c class] [-f font] [-g geometry] [-o file]" \
+ " [-t title] [-w windowid] [-e command ...]\n"
 
 /* XEMBED messages */
 #define XEMBED_FOCUS_IN 4
_AT_@ -365,11 +365,12 @@
 static pid_t pid;
 static Selection sel;
 static int iofd = -1;
-static char **opt_cmd = NULL;
-static char *opt_io = NULL;
+static char **opt_cmd = NULL;
+static char *opt_io = NULL;
 static char *opt_title = NULL;
 static char *opt_embed = NULL;
 static char *opt_class = NULL;
+static char *opt_font = NULL;
 
 void *
 xmalloc(size_t len) {
_AT_@ -2087,7 +2088,7 @@
         xw.vis = XDefaultVisual(xw.dpy, xw.scr);
 
         /* font */
- initfonts(FONT);
+ initfonts((opt_font != NULL)? opt_font : FONT);
 
         /* XXX: Assuming same size for bold font */
         xw.cw = dc.font.rbearing - dc.font.lbearing;
_AT_@ -2503,22 +2504,19 @@
 
         for(i = 1; i < argc; i++) {
                 switch(argv[i][0] != '-' || argv[i][2] ? -1 : argv[i][1]) {
- case 't':
- if(++i < argc) opt_title = argv[i];
- break;
                 case 'c':
- if(++i < argc) opt_class = argv[i];
- break;
- case 'w':
- if(++i < argc) opt_embed = argv[i];
- break;
- case 'f':
- if(++i < argc) opt_io = argv[i];
+ if(++i < argc)
+ opt_class = argv[i];
                         break;
                 case 'e':
                         /* eat every remaining arguments */
- if(++i < argc) opt_cmd = &argv[i];
+ if(++i < argc)
+ opt_cmd = &argv[i];
                         goto run;
+ case 'f':
+ if(++i < argc)
+ opt_font = argv[i];
+ break;
                 case 'g':
                         if(++i >= argc)
                                 break;
_AT_@ -2540,9 +2538,21 @@
                         if(xw.fh != 0 && xw.fw != 0)
                                 xw.isfixed = True;
                         break;
+ case 'o':
+ if(++i < argc)
+ opt_io = argv[i];
+ break;
+ case 't':
+ if(++i < argc)
+ opt_title = argv[i];
+ break;
                 case 'v':
                 default:
                         die(USAGE);
+ case 'w':
+ if(++i < argc)
+ opt_embed = argv[i];
+ break;
                 }
         }
 
Received on Sun Sep 30 2012 - 20:25:41 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 30 2012 - 20:36:06 CEST