aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/units
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-152-2/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* usr.bin/units: use else..if to avoid calling the next branchrilysh2024-04-191-2/+1
| | | | | | | | | | Even if the first branch succeeds, next time it will still check for the second branch (which will be false) as the first one was true. Add an else..if statement to address this. Signed-off-by: rilysh <nightquick@proton.me> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1165
* Purge more stray embedded $FreeBSD$ stringsJohn Baldwin2023-09-251-5/+0
| | | | | | | These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-167-7/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* units: Remove set but unused variable.John Baldwin2023-06-201-3/+1
| | | | Reported by: GCC
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-2/+2
|
* Tell the world how to convert gigabytes to bytes with units(1) easilyMateusz Piotrowski2020-03-171-5/+18
| | | | | | | | | | | | | | | | | | | | | | | It turns out that units(1) is not as horrible to use in scripts as I initially thought. When the --terse flag is combined with an appropriate output format (set via --output-format), units(1) is actually capable of producing very nice results. For example: units -o %0.f -t '4 gigabytes' bytes is is just going to print out the expected value of 4294967296. There is no time to waste. People have to know about it. I am adding an example for this at the top of the examples section because this is what users are most likely looking for. Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D24096 Notes: svn path=/head/; revision=359032
* units(1): Refactor the manual page and update usage informationMateusz Piotrowski2020-02-032-117/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to units.1: - Change the description to a more descriptive "conversion calculator". - Sort options. - Split the description into sections to make it easier to navigate the manual page. - Improve the description of various options. - Document the default value of the output format. - Use more mdoc macros for better readability. - Document the behavior of the PATH environmental variable. - Improve examples. - Add sections: EXIT STATUS, DIAGNOSTICS, and HISTORY. - Document that units(1) cannot convert negative values and it handles long unit lists poorly. - Update the documentation of the -V flag to match the implementation. units(1) prints its version and the units data file instead of its version and usage information. Changes to units.c: - Update usage information. - Sort longopts elements. This commit does not attempts to change the current behavior of units(1). What's left to do is probably defining a better versioning (at the moment units(1) always reports "FreeBSD units" as its version) and changing the behavior of the -V flag to only print version. Reviewed by: allanjude (earlier version), bcr Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D18977 Notes: svn path=/head/; revision=357449
* Correct a typo: was -> way.Glen Barber2019-01-211-1/+1
| | | | | | | | | Submitted by: Larry Hynes MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=343259
* capsicum: use a new capsicum helpers in toolsMariusz Zaborski2018-11-041-2/+1
| | | | | | | Use caph_{rights,ioctls,fcntls}_limit to simplify the code. Notes: svn path=/head/; revision=340138
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-3/+3
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* units: fix some nitsEitan Adler2018-06-161-4/+5
| | | | | | | | | - prefer braces to abusing the `,` operator - mark dead function as dead - remove dead break Notes: svn path=/head/; revision=335265
* units(1): units(1) free savescr in error condition tooEitan Adler2018-01-151-2/+8
| | | | | | | | | CID: 978392 Reviewed by: des MFC After: 1 week Notes: svn path=/head/; revision=328008
* units(1): add missing ':' for two short argumentsEitan Adler2018-01-051-1/+1
| | | | | | | | PR: 209850 MFC After: 3 days Notes: svn path=/head/; revision=327578
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Update URLs in usr.binEitan Adler2017-10-291-3/+3
| | | | | | | | | - http -> https - contents have moved locations - removal of URL if I could not find new location Notes: svn path=/head/; revision=325095
* Add supporting changes for `Add limited sandbox capability to "make check"`Enji Cooper2017-08-141-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-tests/... changes: - Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration and propagate the appropriate environment down to *.test.mk. tests/... changes: - Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner, since tests/... is a special subdirectory tree compared to the others. MFC after: 2 months MFC with: r322511 Reviewed by: arch (silence), testing (silence) Differential Revision: D12014 Notes: svn path=/head/; revision=322515
| * Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | | | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* | Correct the -H longopt equivillantSevan Janiyan2017-08-121-2/+2
|/ | | | | | | | | | PR: 209876 Submitted by: <kdrakehp AT zoho DOT com> Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D11988 Notes: svn path=/head/; revision=322424
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* Escape No to avoid confusion with the No macroBaptiste Daroussin2017-02-111-9/+9
| | | | | | | | Reported by: make manlint MFC after: 2 days Notes: svn path=/head/; revision=313664
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* Bring a little more compability with GNU units 2.12Eitan Adler2016-04-212-14/+34
| | | | | | | | | | | | | | - notionally support a 'history file' flag. This doesn't do much now, but is there to prevent scripts written against GNU units from breaking - correctly gracefully quit rather than exit (this will make it easier to support a history file in the future) - remove the "t" flag from fopen which was there to support windows. We have not supported windows since at the latest, the introduction of capsicum. Notes: svn path=/head/; revision=298388
* Fix build breakage introduced by r298253.Xin LI2016-04-191-1/+1
| | | | Notes: svn path=/head/; revision=298257
* Rename units.lib -> definitions.unitsEitan Adler2016-04-193-3/+167
| | | | | | | | - this matches GNU units 2.12 add ISO country codes from units 2.12 Notes: svn path=/head/; revision=298253
* Remove pathnames.hEitan Adler2016-04-192-34/+1
| | | | | | | | - it only holds a single constant - it doesn't exist in the GNU variant Notes: svn path=/head/; revision=298251
* MFHGlen Barber2016-03-101-0/+11
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+11
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | First pass to fix the 'tests' packages.Glen Barber2016-02-021-0/+4
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andEnji Cooper2015-10-121-2/+0
| | | | | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison Notes: svn path=/head/; revision=289172
* Fix interaction between libedit initialization and CapsicumEdward Tomasz Napierala2015-08-081-5/+7
| | | | | | | | | | | | | in units(1). The most visible is the removal of libedit warnings about being unable to open termcap database. Reviewed by: eadler@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3322 Notes: svn path=/head/; revision=286446
* Only initialize libedit when necessaryJulio Merino2015-06-281-13/+14
| | | | | | | | | | | | | | | | | The code path to support units conversions from the command line need not initialize neither libedit nor the history. Therefore, only do that when in interactive mode. This hides the issue reported in PR bin/201167 whereby running commands of the form 'echo "$(units ft in)"' would corrupt the terminal. The real issue causing the corruption most likely still remains somewhere. PR: bin/201167 Differential Revision: D2935 Reviewed by: eadler Notes: svn path=/head/; revision=284912
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge head from 7/28Simon J. Gerraty2014-08-197-93/+191
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | New/updated dependenciesSimon J. Gerraty2014-05-051-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265381
| * | Merge headSimon J. Gerraty2014-04-284-64/+154
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-251-2/+1
| |_|/ |/| | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* | | Fix structure of new tests (r268794) for usr.bin/units.Julio Merino2014-07-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make sure the tests go into the right directory. The location was wrong so they were overwriting the bin/chown tests! - Use the right naming scheme for the test program. - Remove the svn:executable property from the shell script. Notes: svn path=/head/; revision=269084
* | | Replace all uses of libncurses and libtermcap with their wide characterBrooks Davis2014-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variants. This allows usable file system images (i.e. those with both a shell and an editor) to be created with only one copy of the curses library. Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=268804
* | | units(1): Add basic testsEitan Adler2014-07-173-0/+37
| | | | | | | | | | | | | | | | | | | | | Add some tests to help avoid breaking units Notes: svn path=/head/; revision=268794