summaryrefslogtreecommitdiff
path: root/src/numfmt.c
AgeCommit message (Collapse)Author
2013-02-20build: fix numfmt build error on compilers without __attributeJoachim Schmitz
* src/numfmt.c (): Use the more standard _GL_ATTRIBUTE_PURE which is elided where required. Reported in http://bugs.gnu.org/10305
2013-02-14build: avoid link failure in devmsg() on older linkersPádraig Brady
On linkers that don't remove unused functions, there will be a reference to a missing dev_debug symbol in the devmsg() function. So for now ... * src/system.h: ... move devmsg() from here ... * src/numfmt.c: ... to here, and document future cleanup. * src/factor.c: Likewise.
2013-02-13numfmt: fix strtol() return code handlingAssaf Gordon
src/numfmt.c (parse_format_string): On some systems, strtol() returns EINVAL if no conversion was performed. So only handle ERANGE here, and handle other format errors directly.
2013-02-11doc: improve the numfmt man page formatPádraig Brady
* src/numfmt.c (usage): Keep a single space between the "K = 1000", so that it's not displayed on a separate line. Also place ',' between each unit entry to improve readability.
2013-02-10doc: standardize helptext of numfmt and slice into single optionsBenno Schulenberg
* src/numfmt.c (usage): Correct synopsis and make command description clearer. Start option descriptions with lowercase letter; use semicolon instead of period where needed; indent continuation lines; gettextize single options for ease of translation and maintenance; sort options alphabetically. * doc/coreutils.texi (numfmt invocation): Sort numfmt options alphabetically. Enforce double-blank-after-period style. This addresses http://bugs.gnu.org/13681. Improved-by: Bernhard Voelker
2013-02-10maint: consolidate developer debug messagesPádraig Brady
Both factor and numfmt recently introduced debug messages for developers, enabled by --verbose and ---devdebug respectively. There were a few issues though: 1. They used different mechanisms to enable these messages. 2. factor used --verbose which might be needed for something else 3. They used different methods to output the messages, and numfmt used error() which added an unwanted newline 4. numfmt marked all these messages for translation and factor marked a couple. We really don't need these translated. So we fix the above issues here while renaming the enabling option for both commands to ---debug (still undocumented). * src/factor.c (verbose): Rename to dev_debug and change from int to bool as it's just a toggle flag. (long_options): Rename --verbose to ---debug. * src/system.h (devmsg): A new inline function to output a message if enabled by a global dev_debug variable in the compilation unit. * src/numfmt.c: Use devmsg() rather than error(). Also remove the translation tags from these messages. Also change debug flag to bool from int. * tests/misc/numfmt.pl: Adjust for the ---devdebug to ---debug change. * cfg.mk (sc_marked_devdiagnostics): Add a syntax check to ensure translations are not added to devmsg calls. Reported by Göran Uddeborg in http://bugs.gnu.org/13665
2013-02-05doc: fix a numfmt help section typoAssaf Gordon
* src/numfmt.c (usage): Change erroneous "G" to "M".
2013-02-05numfmt: correct a printf formatPádraig Brady
Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/4010493 * src/numfmt.c (parse_format_string): Correct both sign and size of a printf format, which only gives a warning on 32 bit builds.
2013-02-04numfmt: a new command to format numbersAssaf Gordon
* AUTHORS: Add my name. * NEWS: Mention the new program. * README: Reference the new program. * src/numfmt.c: New file. * src/.gitignore: Ignore the new binary. * build-aux/gen-lists-of-programs.sh: Update. * scripts/git-hooks/commit-msg: Allow numfmt: commit prefix. * po/POTFILES.in: Add new c file. * tests/misc/numfmt.pl: A new test file giving >93% coverage. * tests/local.mk: Reference the new test. * man/.gitignore: Ignore the new man page. * man/local.mk: Reference the new man page. * man/numfmt.x: A new template. * doc/coreutils.texi: Document the new command.