Commit Graph

862 Commits

Author SHA1 Message Date
Karel Zak 9a66e1e76f lib/tt: add tt_line_get_userdata()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 60ec67ff4e lib/colors: add info to man pages, add terminal-colors.d.5
Co-Author: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 10:05:32 +01:00
Ondrej Oprala d0c9ddc3cc lib/colors: check for /etc/terminal-colors.d/[util].disable
[kzak@redhat.com: - move paths to pathnames.h,
                  - use static path buffer]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 09:38:09 +01:00
Karel Zak 5a2fd9329e lsblk: add PARTFLAGS column
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-07 11:14:46 +01:00
Sami Kerola 4b670c01df logger: allow user to send structured journald messages
This feature is hopefully mostly used to give MESSAGE_ID labels for
messages coming from scripts, making search of messages easy.  The
logger(1) manual page update should give enough information how to use
--journald option.

[kzak@redhat.com: - add missing #ifdefs
                  - use xalloc.h]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-04 13:44:21 +01:00
Karel Zak 2b6759df0c findmnt: add --bytes to print sizes in bytes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-02-21 12:27:58 +01:00
Karel Zak 6c373810f5 libmount: FS id and parent ID could be zero
It seems that linux 3.14 is able to produce things like:

  19 0 8:3 / / rw,relatime - ext4 /dev/sda3 rw,data=ordered
     ^

Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-02-20 16:59:11 +01:00
Sami Kerola 0c6dc4b99f cal: remove unnecessary static variables
Not in use since commit 95f4adde86.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-02-10 19:09:37 +01:00
Ville Skyttä ad1d426aea getopt.1: The usual doc dir is /usr/share/doc, not .../docs
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2014-02-10 18:38:39 +01:00
Michael Marineau 4686ba17a8 lsblk: add PARTTYPE tag
To stay in sync with blkid add PARTTYPE as an available output column.
2014-02-10 10:47:21 +01:00
Sami Kerola 4a7424a5ef cal: limit year to 32 bit value
This is done to keep things simple, when considering tests, for both 64
and 32 bit architectures.  Setting the upper limit of a year value to to
2^31-1 (2147483646) should be enough for anyone.

Reported-by: Mike Frysinger <vapier@gentoo.org>
Reference: http://www.spinics.net/lists/util-linux-ng/msg08662.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-02-06 16:55:22 +01:00
Karel Zak 081dc33b46 wipefs: call BLKRRPART when erase partition table
It's better to be smart than make things inconsistent (without
BLKRRPART kernel still uses the erased PT and udev-db still contains
obsolete information).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-20 12:16:47 +01:00
Karel Zak 90faf9eb07 wipefs: add comments to code 2014-01-16 16:33:16 +01:00
Karel Zak af5f87a678 rename: fix mem leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-14 17:56:47 +01:00
Sami Kerola ea45d34c7c uuidd: use pkg-config to find systemd-deamon support
[kzak@redhat.com: - remove USE_SOCKET_ACTIVATION and use
                    HAVE_* as we use for another libs]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-07 12:17:37 +01:00
Benno Schulenberg cad44d02bd cal: in man page improve grammar and wording of the reformation limitation
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-01-07 09:44:01 +01:00
Benno Schulenberg 2d4f3bfb7f cal: in man page admit that any week has just one Sunday
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-06 12:42:05 +01:00
Sami Kerola bc36e66a84 cal: mention where Gregorian reformation happen in September 1752
In September 1752 the Gregorian reformation happen in Great Britain and
Dominions (including what is now the USA).  One could argue the cal(1)
should consider locale when determining the reformation, but such is
nearly impossible implement correctly.

The dates when reformation happen are split by areas that cannot be
expressed with current locales, for example the Netherlands is split to
two and Germany three categories depending on where in the modern country
one is.  Secondly the track when reformation happen is lost for some
countries, Lithuania or Japan are good examples of such.

One of the worst for a programmer is Sweden.  They got gradual calendar
change which made Swedish calendar to be completely out of sync.  Later
the Swedish calendar jumped in 1753 to be in sync with everyone else.

Notice that some countries, including Saudi Arabia, Ethiopia, Nepal, Iran
and Afghanistan, still have not adopted the Gregorian calendar.  Hence
the output of the cal(1) cannot be considered to be correct for everyone.

References: http://calendopedia.com/gregory.htm
References: http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-01-06 12:41:51 +01:00
Karel Zak bebdda3036 findmnt: add -U to de-deplicate filesystems
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-11 17:01:15 +01:00
Karel Zak b95c6e88b5 findmnt: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-11 14:47:06 +01:00
Sami Kerola 95f4adde86 cal: use month contents structure for --year printing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:55 +01:00
Sami Kerola f60117b53e cal: use month contents structure for --three printing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola 852c8d2110 cal: add month contents structure
This changes determination of calendar month content completely, as well
as outputing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola efce94ec1c cal: determine how many header lines are needed at initialization
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola ffc5635798 cal: make user request to be part of read-only control struct
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola 71ff238e49 cal: determine output width at beginning of run and reuse result
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola 44df9bd4bf cal: simplify ascii_weeknum() function
Either the week is or isn't highlighted, there is no need to over
complicate printing of that.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola ff90b006eb cal: make day_in_week() use same variable names as other functions
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola 0106c9e26c cal: add input variable names to function prototypes
While prototypes such as 'function(int, int, char, int);' are legal they
do not help when trying to understand how the function is expected to be
used.  Adding variable names gives at least a hint when looking the
prototypes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:54 +01:00
Sami Kerola 76c4bbcc6e cal: rename ascii_wnum() to ascii_weeknum()
Week is not long word, so it does not need to be enshorted and made more
difficult to understand.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:52 +01:00
Sami Kerola b549058bd5 cal: use control structure for run time configuration
Runtime configuration is set at the time of command line option parsing,
and other initialization.  Later the configuration is read-only.  This
should make code a little bit more understandable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06 10:58:52 +01:00
Sami Kerola cd80445017 namei: align missing files with rest of the print out
This change should make namei output more readable when multiple
arguments are supplied.

The old:

$ namei -l /usr/foo
f: /usr/foo
drwxr-xr-x root root /
drwxr-xr-x root root usr
foo - No such file or directory

The new:

$ namei -l /usr/foo
f: /usr/foo
drwxr-xr-x root root /
drwxr-xr-x root root usr
                     foo - No such file or directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-02 10:59:27 +01:00
Karel Zak 71d842c019 lsblk: fix -D segfault
References: https://bugzilla.redhat.com/show_bug.cgi?id=1031262
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-18 11:27:35 +01:00
Phillip Susi 856ee0ba61 blkid: simple typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-08 10:12:17 +01:00
Karel Zak 1c9885cde8 blkid: escape quotes in the output
# e2label /dev/loop0 'La"bel'
 # blkid -p /dev/loop0
 /dev/loop0: LABEL="La"bel"  ....

new version:

 /dev/loop0: LABEL="La\"bel" ....

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-07 14:10:26 +01:00
Karel Zak c1732e6234 cal: fix coding style
- mostly space around operators
 - split yearly(), move weeknum stuff to append_wnum()

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-22 11:54:42 +02:00
Tommi Kyntola af7c483e62 cal: remove optional from short arg -w
The long option --week still has the optional argument as --week=<wnum>

This was suggested on the mailing list by Padraig Brady and I do agree with that.
Actually, the whole idea of --week=<wnum> came from him.

Signed-off-by: Tommi Kyntola <kynde@iki.fi>
2013-10-22 10:39:08 +02:00
Tommi Kyntola aae4f87e68 cal: added argument option for -w|--week to display that week
Because many years have two sections of week 52 or 53, the week that
this argument points to is the one that starts during that year (when available).
The week number in argument is also highlighted in addition to possibly visible
current/defined date highlighting.

Signed-off-by: Tommi Kyntola <kynde@iki.fi>
2013-10-22 10:32:32 +02:00
Tommi Kyntola c36c4a4e4d cal: added -w|--week for showing week numbers
Added week numbers both in ISO-6801 and North America numbering.
The mode is determined by first day of the week, Monday
for ISO and Sunday for North America mode.

ISO week numbers are defined as the first Thursday being part of week 1.
The North America numbering is defined, at least by gcal, as first Sunday
being in the first week.

Signed-off-by: Tommi Kyntola <kynde@iki.fi>
2013-10-22 10:27:03 +02:00
Karel Zak a814f0bb76 cal: fix compiler warning on systems without term libs
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15 15:44:40 +02:00
Karel Zak 7bd3336f9a cal: fix warning when compiled --without-ncurses
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15 13:29:19 +02:00
Benno Schulenberg b4362b6f84 docs: standardize the phrases for --help and --version in all man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15 10:28:30 +02:00
Benno Schulenberg e009d80878 docs: improve formatting and wording of the getopt man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14 14:55:26 +02:00
Benno Schulenberg f8bc8ce464 docs: sort the options in the logger man page alphabetically
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14 14:55:25 +02:00
Benno Schulenberg e3a4ee432f docs: improve a bit the wording on the logger man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14 14:55:24 +02:00
Benno Schulenberg 3e59c48159 textual: remove duplicate mention of '--help' from lsblk help text
Also improve the alphabetization of the other options.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14 14:54:47 +02:00
Karel Zak 88a3be2602 build-sys: move getopt examples to docdir
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-14 10:13:47 +02:00
Karel Zak 2ec8187eed cal: fix gettext warning
/usr/bin/xgettext: Non-ASCII comment at or before misc-utils/cal.c:473.
                   Please specify the source encoding through --from-code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-11 12:53:56 +02:00
Pádraig Brady 233ad1fa9b cal: improve the help text and man page
* misc-utils/cal.c: Add a little doc string, and mention that the
  current month is implicit if not specified.  Also remove mention
  of "current" from two option descriptions as a specific date may
  have been specified.
* misc-utils/cal.1: Likewise.

[kzak@redhat.com: - use fputs and USAGE_SEPARATOR]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-11 10:44:21 +02:00
Benno Schulenberg 119ed9bfcd textual: tag a translator comment and put it in proper place
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08 15:38:39 +02:00