Commit graph

58 commits

Author SHA1 Message Date
Gabriel Ganne
64009b090f ls: implement --color=auto behavior
The automatic behavior is to turn on colors only of connected to a
terminal.
Introduce new external crate isatty to handle this.

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
2019-06-23 10:38:39 +02:00
Gabriel Ganne
edaf2d85cb ls: implement --color flag
GNU coreutils ls command implements the --color option as follow:
  --color[=WHEN]
          colorize the output; WHEN can be 'always' (default if omitted),
          'auto', or 'never'

With --color=auto, ls emits color codes only when standard output is connected
to a terminal.

Also, add support for the following aliases:
  - ‘always’, ‘yes’, ‘force’
  - ‘never’, ‘no’, ‘none’
  - ‘auto’, ‘tty’, ‘if-tty’

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
2019-06-23 10:35:30 +02:00
Alex Lyon
b73a664677 Split off uucore into its own repository 2019-05-12 22:42:20 -07:00
Alex Lyon
db35eab23b Remove git dependencies 2019-05-01 21:14:39 -07:00
Alex Lyon
220e07dc95 Test on FreeBSD using Cirrus CI and link to the Discord in the README 2019-05-01 21:14:25 -07:00
Alex Lyon
313ad332fa
Merge pull request #1290 from ArniDagur/ls-formatting
Change `ls -l -h` formatting to match GNU ls
2019-02-07 00:12:43 -08:00
Alex Lyon
5a17daa963
Merge pull request #1281 from rivy/alt/win-cli-globbing
Add command line globbing to all utilities (for windows targets)
2019-02-06 23:21:53 -08:00
Roy Ivy III
197bd2e10c fix: gate unix-only macros (silences "unused" warnings) 2018-10-14 00:41:14 -05:00
Árni Dagur
3367d3d979
Switch to using rust-number-prefix from pretty-bytes 2018-09-18 22:16:34 +00:00
Árni Dagur
9207269791
Change 'ls -l -h' formatting to match GNU ls
Before:
-rw-r--r--  1 arni arni  2.02 kB 2018-09-14 21:07 CONTRIBUTING.md
-rw-r--r--  1 arni arni 78.75 kB 2018-09-14 23:41 Cargo.lock
-rw-r--r--  1 arni arni  6.92 kB 2018-09-14 21:07 Cargo.toml
-rw-r--r--  1 arni arni  1.05 kB 2018-09-14 21:07 LICENSE
-rw-r--r--  1 arni arni  5.98 kB 2018-09-14 21:07 Makefile
-rw-r--r--  1 arni arni 10.68 kB 2018-09-14 21:07 README.md
-rw-r--r--  1 arni arni  2.22 kB 2018-09-14 21:07 appveyor.yml
-rw-r--r--  1 arni arni   2.9 kB 2018-09-14 21:07 build.rs
-rw-r--r--  1 arni arni     15 B 2018-09-14 21:07 codecov.yml
drwxr-xr-x  2 arni arni   4.1 kB 2018-09-14 21:07 docs
-rw-r--r--  1 arni arni    973 B 2018-09-14 21:07 mkmain.rs
drwxr-xr-x 97 arni arni   4.1 kB 2018-09-14 21:07 src
drwxr-xr-x  3 arni arni   4.1 kB 2018-09-14 21:08 target
drwxr-xr-x  4 arni arni   4.1 kB 2018-09-14 21:07 tests
-rw-r--r--  1 arni arni     48 B 2018-09-14 21:07 uumain.rs

After:
-rw-r--r--  1 arni arni  2.02K 2018-09-14 21:07 CONTRIBUTING.md
-rw-r--r--  1 arni arni 78.68K 2018-09-16 20:39 Cargo.lock
-rw-r--r--  1 arni arni  6.92K 2018-09-14 21:07 Cargo.toml
-rw-r--r--  1 arni arni  1.05K 2018-09-14 21:07 LICENSE
-rw-r--r--  1 arni arni  5.98K 2018-09-14 21:07 Makefile
-rw-r--r--  1 arni arni 10.68K 2018-09-14 21:07 README.md
-rw-r--r--  1 arni arni  2.22K 2018-09-14 21:07 appveyor.yml
-rw-r--r--  1 arni arni   2.9K 2018-09-14 21:07 build.rs
-rw-r--r--  1 arni arni     15 2018-09-14 21:07 codecov.yml
drwxr-xr-x  2 arni arni   4.1K 2018-09-14 21:07 docs
-rw-r--r--  1 arni arni    973 2018-09-14 21:07 mkmain.rs
drwxr-xr-x 97 arni arni   4.1K 2018-09-14 21:07 src
drwxr-xr-x  3 arni arni   4.1K 2018-09-14 21:08 target
drwxr-xr-x  4 arni arni   4.1K 2018-09-14 21:07 tests
-rw-r--r--  1 arni arni     48 2018-09-14 21:07 uumain.rs
2018-09-16 20:42:11 +00:00
Vinzent Steinberg
e46e3594d2 Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
dependabot[bot]
2c796811ca
Bump getopts from 0.2.17 to 0.2.18
Bumps [getopts](https://github.com/rust-lang/getopts) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/rust-lang/getopts/releases)
- [Commits](https://github.com/rust-lang/getopts/compare/0.2.17...v0.2.18)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-07-06 07:17:46 +00:00
dependabot[bot]
f007268c9c
Bump unicode-width from 0.1.4 to 0.1.5
Bumps [unicode-width](https://github.com/unicode-rs/unicode-width) from 0.1.4 to 0.1.5.
- [Release notes](https://github.com/unicode-rs/unicode-width/releases)
- [Commits](https://github.com/unicode-rs/unicode-width/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-15 07:24:50 +00:00
dependabot[bot]
4a4877264c
Bump time from 0.1.39 to 0.1.40
Bumps [time](https://github.com/rust-lang/time) from 0.1.39 to 0.1.40.
- [Release notes](https://github.com/rust-lang/time/releases)
- [Commits](https://github.com/rust-lang/time/compare/0.1.39...0.1.40)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-14 07:22:03 +00:00
dependabot[bot]
d1c18c01e9
Bump lazy_static from 1.0.0 to 1.0.1
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/commits/v1.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-08 07:30:48 +00:00
dependabot[bot]
5b5aaa03c9
Bump lazy_static from 0.2.11 to 1.0.0
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 0.2.11 to 1.0.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-07 07:25:48 +00:00
Valentin Lorentz
43aafd2f1c chmod: show human-friendly permissions when --changes or --verbose is used.
Like GNU chmod.
2018-05-02 23:23:05 +02:00
Michael Aaron Murphy
dddc773200 [ls] Add "-1" Flag & Fix Needless Vec 2018-04-10 22:13:21 -04:00
Alex Lyon
bd557c87fb uucore: make features opt-in rather than opt-out 2018-03-12 20:21:38 -07:00
Alex Lyon
880a4973c1 Format everything using rustfmt 2018-03-12 01:20:58 -07:00
Alex Lyon
7aea948473
Remove pipe_* macros 2017-12-10 20:57:39 -08:00
Alex Lyon
75f11e9635
Handle SIGPIPE correctly and autogenerate main() for each util 2017-12-08 15:05:07 -08:00
Gerald E Butler
0268cf75cd Added a check to see if the input file/path that ls is run on when using -l or other long options, that if the path part ends with '/' then it does not show it as a soft-link if it is a soft-link but, instead shows the directory contents of the directory the soft-link points to - see https://github.com/uutils/coreutils/issues/1093 2017-11-13 21:34:40 -05:00
Alex Lyon
86aa1eb47a ls: fix line that was forgotten in #1057 2017-07-27 00:09:42 -07:00
Alex Lyon
4a5b76f678 Merge pull request #1057 from ids1024/ls
Fix ordering of ls -t, which was backwards
2017-07-26 21:18:00 -07:00
Ian Douglas Scott
3c3f5ab2a3
Fix ordering of ls -t, which was backwards 2017-07-26 20:57:44 -07:00
Ian Douglas Scott
b9446c0766
Make ls build on Redox 2017-07-25 16:26:36 -07:00
Joshua Miller
e8073d2596 pin dependencies 2017-07-15 15:16:09 -05:00
Shinichiro Hamaji
36d26c0f0d ls: Implement -n option 2017-04-02 13:11:48 +09:00
Shinichiro Hamaji
e4ad79f46e ls: Implement -B option 2017-04-01 19:47:52 +09:00
Sunrin SHIMURA (keen)
20b336ed3c remove redundant space 2017-01-10 10:37:34 +09:00
Sunrin SHIMURA (keen)
59e4bc431a ls: return String, not Option<String> 2016-12-26 12:27:06 +09:00
Sunrin SHIMURA (keen)
8a51ddf6fb ls: implement -i option 2016-12-25 14:39:29 +09:00
Lei Zhang
a34cd30f54 Enable compilation of ls on Fuchsia.
This updates the dependency of pretty-bytes to v0.2.
2016-12-14 23:29:38 -05:00
Will Wykeham
0809dce4a2 Fix a number of Windows build warnings 2016-11-18 13:58:36 +00:00
Zephiris
0d0087053f ls: Fix '-aR' recursion.
ls with -aR was recursing infinitely becacuse it
added ./.. to every node. I don't see a way to
avoid this except by cloning when that option
is used.
2016-11-05 01:29:55 -07:00
Zephiris
606c1badd2 ls: Change symlink behavior to be more POSIX compliant.
Symlink directories are read by default, and symlink targets are listed on
Windows.
2016-11-05 00:22:55 -07:00
Nathan Ross
36503a77c7 impl: use coreopts for brevity and consistent UX 2016-08-20 10:07:24 -04:00
Knight
f66aaa8b78 ls: use uucore::entries 2016-08-20 03:10:36 +08:00
Mark Karasek
59ad388cce ls: remove dependence on nightly 2016-07-29 07:07:38 -07:00
Mark Karasek
900cd41eb6 ls improvments
* Add options -c, -F, -L, -l, -r, -R, -S, -t, -U, --color
* Fix options -a, -A
* Remove unused options
* Output in columns when not using -l
* Output date with -l
2016-07-28 17:41:52 -07:00
Kevin Robert Stravers
5226ba963c ls: Implement the '-a' (all) flag
The all flag did not cull/remove the directory entries starting with a
dot. The help message indicates it should. The implementation checks
if the string starts with a dot whilst also using '-a' to determine
whether a DirEntry is to be printed.
2016-07-27 11:29:27 +02:00
Kevin Robert Stravers
0afe9b347e ls: Show columns correctly padded according to the largest file and the largest symlink count 2016-07-26 16:05:20 +02:00
Knight
537ed734af ls: display the correct permissions 2016-06-07 21:10:00 +08:00
Knight
ca6831ef91 ls: fix target_family 2016-06-07 20:11:40 +08:00
Knight
0394d5398d ls: rustfmt the code 2016-06-07 20:07:15 +08:00
Steve Smith
7a3ba3242a Need to make the use Linux-only too. 2016-06-05 11:45:44 +01:00
Steve Smith
1606770a3e getpwuid is linux platform only currently. 2016-06-05 11:07:28 +01:00
Steve Smith
8161bb7fe1 Flag uname/group functions as unix-specific and add NO-OP Windows versions. 2016-06-04 15:30:39 +01:00
Steve Smith
ce7f23bcc4 Fill in group name for ls 2016-06-04 15:14:59 +01:00