Commit Graph

35 Commits

Author SHA1 Message Date
Jim Warner
f865ccbff9 watch: correct differences option, eliminate duplicate help text 2012-01-05 10:07:08 +11:00
Sami Kerola
7ac61b3fa1 watch: halt screen at exit on error
This change allows user to see what was the last message before exit
on error, and when where the last update.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-05 09:58:24 +11:00
Sami Kerola
21b5980f82 watch: include strutils.h
Without the header strtod_or_err() returned random value.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-05 09:58:19 +11:00
Craig Small
f776e59123 fixed e and x options in watch
The -e option would print a confusing error message. This is because
most error messages in watch are one word.  This fix makes a more
sensible message about what went wrong.

The -x option exited before the endwin() function was called, so if the
child process died the terminal was left in a funky state. endwin is now
called just before the exit(8) for the -x option.
2012-01-04 09:18:16 +11:00
Craig Small
fb11e1fe0a Changed the err and warns to macros
err and warn are BSD format but they are not recommended by library
developers.  However their consiseness is useful!

The solution is to use some macros that create xerr etc which then
just map to the error() function.  The next problem is error() uses
program_invocation_name so we set this to program_invovation_short_name

This is a global set but seems to be the convention (or at least errors
are on the short name only) used everywhere else.
2012-01-03 18:48:43 +11:00
Sami Kerola
c3405fab1a translations: group usage texts
Reference: http://www.freelists.org/post/procps/backporting,5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-02 16:29:03 +11:00
Sami Kerola
5862f47b96 watch: use strtod_or_err() to validate user input
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:55 +01:00
Sami Kerola
0022b6ec5d nls: improve translations and provide translator help comments
Reference: http://www.freelists.org/post/procps/backporting,1
Reported-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:54 +01:00
Sami Kerola
c862a4caa5 nls: add functions which take translations to be used
Add the following three functions to most of the commands.

setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);

Reference: http://www.freelists.org/post/procps/backporting,1
Reported-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
1ef14f4bf9 includes: add xalloc.h to unify memory allocations
The xalloc.h provides necessary error checking.

Signed-off-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:50 +01:00
Sami Kerola
f90e436b88 watch: add gettext support
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:18:25 +01:00
Sami Kerola
6dd092412f watch: new usage & fix coding style
Coding style fixed and more readable help output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:17:01 +01:00
Craig Small
367b8bb616 Fixed watch 8 bit so its optional
You can make watch 8bit clean by using the configure option
--enable-watch8bit
2011-12-20 22:12:37 +11:00
Jarrod Lowe
8967f0fca3 watch: support unicode
A patch from Debian.

Bug-Debian: http://bugs.debian.org/240989
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/procps/+bug/318221
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-19 21:57:09 +11:00
Anthony DeRobertis
0dbdb862b1 watch: add precision wait time option -p
A patch from Debian.

Bug-Debian: http://bugs.debian.org/183486
Reviewed-by: Craig Small <csmall@debian.org>
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-19 21:57:09 +11:00
Craig Small
39a2f5d717 watch: interpret ANSI color code sequences
A patch from Debian.

Bug-Debian: http://bugs.debian.org/129334
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-19 21:56:02 +11:00
Mordechai T. Abzug
db552d38bc watch: add -exec and -beep flags and has better quoting
Additionally add -errexit flag (#183346).

A patch from Debian.

Bug-Debian: http://bugs.debian.org/410967
Bug-Debian: http://bugs.debian.org/183346
Reviewed-by: Craig Small <csmall@debian.org>
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-18 22:59:15 +11:00
Craig Small
b0ed746267 Watch uses unsigned chars to be 8bit clean
Taken from the Debian patch watch_8bitchar
2011-11-28 22:39:09 +11:00
Sami Kerola
17affc6637 watch.c: fix version printing
Print same style version string as other procps utilities. Also
the number makes now more sense, when it's coming from autotools
config.h

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-04 17:22:44 +02:00
albert
c0f3df30ca watch: tolerate umlauts 2007-05-28 03:18:52 +00:00
albert
d4a9781d4a avoid integer overflow for usleep() arg 2006-06-17 04:52:42 +00:00
albert
7767733812 dietlibc needs termios.h for struct winsize -- thanks Thomas Ogrisegg 2005-10-30 00:04:21 +00:00
albert
af2077f22d new /proc/vmstat fields 2004-08-27 14:23:36 +00:00
albert
8300609ba9 plenty -- see NEWS file and a diff 2004-07-15 01:17:15 +00:00
albert
1351592110 top: do not refresh like crazy 2003-03-17 23:42:00 +00:00
albert
7775a65c4d explains -t, --no-title #182246 2003-02-24 06:05:34 +00:00
albert
b8e27a1ecf watch -t 2003-02-09 07:27:16 +00:00
albert
3e67b58ec2 satisfy GPL section 2a and LGPL section 2b name+date requirement 2002-12-15 00:30:17 +00:00
albert
36ff49a29e the u arg, U arg, u key, and U key 2002-12-10 03:01:17 +00:00
albert
b657e7e08a NORETURN 2002-12-09 07:53:09 +00:00
albert
d614bf02e6 revert the Nov2002 c99 attempt 2002-11-28 23:09:48 +00:00
albert
bc60aa667d watch 'echo -e "A\n\nB"' 2002-11-28 19:47:16 +00:00
albert
7885375300 clean up code 2002-10-21 23:12:51 +00:00
csmall
e4c67b2724 Put most of the Debian patches in
added a lot of cvsignore files
2002-02-01 23:40:38 +00:00
csmall
03a9b5a30f procps 010114 2002-02-01 22:47:29 +00:00