Commit graph

525 commits

Author SHA1 Message Date
zwPapEr
0e8ae256b5 config: 🔨 refactor read config by name 2020-12-13 10:43:03 +05:30
AJ ONeal
1cdef5fe96 use existing display and layout 2020-12-11 16:43:45 +05:30
AJ ONeal
42c3c8ca62 don't follow symlinks with tree -d 2020-12-11 16:43:45 +05:30
Jay
c67c639327 Implement lsd --tree -d
This commit implements the `-d` option in combination with `--tree` to mimic `tree -d` behaviour. There are also changes to the behaviour of `--tree` and `-R` such that they follow the same behaviour as `tree -d` and `ls -R` i.e. not follwoing symlinked directories unless the `-L` flag is specified.
2020-12-11 16:43:45 +05:30
Peter Stewart
b6bd1d3b55 Apply suggestions from code review
Co-authored-by: Abin Simon <abinsimon10@gmail.com>
2020-11-09 12:19:41 +05:30
Peter Stewart
3439e1d735 Make all known filenames & extensions lower-case and always match by lower-cased name 2020-11-09 12:19:41 +05:30
Peter Stewart
9435de8f78 Fix comments 2020-11-09 12:19:41 +05:30
Peter Stewart
d2094af48b Fix formatting issues 2020-11-09 12:19:41 +05:30
Peter Stewart
d774de41a0 Add case-insensitive matching of known filenames and extensions 2020-11-09 12:19:41 +05:30
VentGrey
0d51c7e1b9 Added space to comply with CI/CD styling 2020-11-04 11:14:27 +05:30
VentGrey
22b040160f renamed to .jl extension 2020-11-04 11:14:27 +05:30
VentGrey
413e2b2ddd Added julia icon for .jl files 2020-11-04 11:14:27 +05:30
zwPapEr
95535cb67c 🔨 move symlink arrow to root level 2020-11-02 22:00:53 +05:30
zwPapEr
b1f37c169f styling: 🔨 move symlink arrow to styling mod and use styling
fix https://github.com/Peltoche/lsd/issues/409
2020-11-02 22:00:53 +05:30
zwPapEr
8c2dc69f67 test/symlink-arrow: 🔍 add more test for symlink-arrow 2020-11-02 22:00:53 +05:30
zwPapEr
ce6ebc170a style: add config for symlink arrow 2020-11-02 22:00:53 +05:30
Jay
c747fea0e9 fix date localisation issues on windows
keep dates in ISO8601 to avoid problems
2020-10-28 22:43:11 +05:30
zwPapEr
3537575d8b icon: add ttc font file
fix https://github.com/Peltoche/lsd/issues/435
2020-10-25 11:02:18 +05:30
Jay
7eeda6c8a2 tidy up matches into maps 2020-10-18 10:51:26 +05:30
zwPapEr
da97ee40f2 skip extension if no ext found
fix https://github.com/Peltoche/lsd/issues/387
2020-10-18 10:51:26 +05:30
Aaron Sun
153576baeb Add more archive icons 2020-10-17 09:33:33 +05:30
Aaron Sun
0ff6f9f34f Remove duplicate line 2020-10-17 09:33:33 +05:30
Tomasz Kłak
4991436cdf Adds sort flag 2020-10-03 17:36:42 +05:30
LHY-iS-Learning
4b0aad609a Fix #408, vol.2 2020-10-02 17:52:44 +05:30
LHY-iS-Learning
353c5ab04c Fix #408 2020-10-02 17:52:44 +05:30
Kai Moschcau
1bebe5b7c6 Reword ignore config option 2020-10-02 10:08:37 +05:30
Kai Moschcau
55a96a114d Add ability to configure default options with file
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	README.md
#	src/app.rs
#	src/core.rs
#	src/display.rs
#	src/flags.rs
#	src/meta/mod.rs
#	src/sort.rs
#	tests/integration.rs
2020-10-02 10:08:37 +05:30
Zach Coyle
5fea5cda09 Add Nix icon 2020-09-28 10:18:25 +05:30
zwPapEr
16f1b1ce7c sort: add version sort
fix https://github.com/Peltoche/lsd/issues/394
2020-09-19 15:37:47 +05:30
Abin Simon
08a55f90d3 use last sort flag for sort
Previously the order was predefined in the binary based on all the ones
that we had. Now we can use the last sort arg passed as the index to
sort.
2020-09-18 19:49:04 +05:30
Allen Hsu
b6378b0ca1 Add support for extension sort. 2020-09-18 19:30:33 +05:30
Allen Hsu
85bee8ba86 Use vec of function pointers over sorting closure. 2020-09-12 15:19:12 +05:30
Allen Hsu
ae11a29ae1 Refactor dirlike into FileType. 2020-09-12 15:19:12 +05:30
Allen Hsu
e7b46aa291 Cache sorter on Core. 2020-09-12 15:19:12 +05:30
Allen Hsu
874d07f89d Create closure to do sorting. 2020-09-12 15:19:12 +05:30
Abin Simon
5c128780f1 fix long listing for symlinkd dirs 2020-08-29 17:13:35 +05:30
Abin Simon
cffda506f1 show contents for symlink folders(fix #345) 2020-08-29 17:13:35 +05:30
Abin Simon
d9b7a5599d do not expand sylink in grid display 2020-08-21 23:40:44 +05:30
zwPapEr
faea1c0051 arg: add support for dereference 2020-08-21 23:27:12 +05:30
Abin Simon
3512ca668f spcial char test only needd for unix 2020-08-08 14:31:32 +05:30
Abin Simon
a7df288df2 add tests for special chars in filename 2020-08-08 14:31:32 +05:30
Abin Simon
5d6392c995 escape special chars in filename 2020-08-08 14:31:32 +05:30
Abin Simon
bef4ad22a6 add test for short size render 2020-08-08 13:17:27 +05:30
Abin Simon
20a6a09695 fix regression causing size short to have space 2020-08-08 13:17:27 +05:30
Jay
549f559305 implement for windows too 2020-08-08 13:02:16 +05:30
Jay
07efe8faa7 change windows struct def 2020-08-08 13:02:16 +05:30
Jay
dc548c2d66 update comments 2020-08-08 13:02:16 +05:30
Jay
05c0888979 update symlink test and repeat test for dirs too 2020-08-08 13:02:16 +05:30
Jay
b15258006e add test for dir symlink 2020-08-08 13:02:16 +05:30
Jay
bcb76a036a update windows FileType 2020-08-08 13:02:16 +05:30
Jay
f3bbf686dc upadte comments 2020-08-08 13:02:16 +05:30
Jay
2b384ed1df refactor symlink check into FileType 2020-08-08 13:02:16 +05:30
Jay
0f8b558493 minor refactor of return value 2020-08-08 13:02:16 +05:30
Jay
3def8d0238 fix icon mistake 2020-08-08 13:02:16 +05:30
Jay
5d608e8493 change yaml icon to indicate data like json and avro 2020-08-08 13:02:16 +05:30
Jay
15736d1c7d fix symlink test 2020-08-08 13:02:16 +05:30
Jay
673374ecab change symlink file to match symlink dir (octicons) 2020-08-08 13:02:16 +05:30
Jay
9b1243f2b0 change to actual symlink icon 2020-08-08 13:02:16 +05:30
Jay
52a8ec70f9 unnecessary dots 2020-08-08 13:02:16 +05:30
Jay
618a83383a sort symlinks appropriatelt with dirs/files 2020-08-08 13:02:16 +05:30
Jay
95c8234e12 implement for windows too 2020-08-08 13:02:16 +05:30
Jay
bb23164d3b change windows struct def 2020-08-08 13:02:16 +05:30
Jay
736e9b7564 tidy comments 2020-08-08 13:02:16 +05:30
Jay
460b8459ca fix panic on broken symlinks; display as file 2020-08-08 13:02:16 +05:30
Jay
8b869ba2ce detect if symlink is_dir and show different icon:  2020-08-08 13:02:16 +05:30
Pingger Shikkoken
e3ed9fa6df Added missing "can" to the text.
The commit messages are more text, than the actual changes ... And even then I made a typo in the code, that I need to fix with this commit ... Stupid me.
2020-08-02 18:42:06 +05:30
Pingger Shikkoken
313369a00c Improve help for '--ignore-glob" argument
Adds the text ". More than one be specified by repeating the argument" to the help of the "--ignore-glob" argument.

(Should be considered, since I needed to dig into the code to find out how this argument works for multiple ignores)
2020-08-02 18:42:06 +05:30
nabakolu
ff08f444fe Added spaces instead of tabs 2020-06-03 10:36:25 +05:30
nabakolu
0f11c0e3fc added music icon for opus filetype 2020-06-03 10:36:25 +05:30
dvvvvvv
1474d6daa4 use as_deref instead as_ref().map(||...) 2020-05-31 16:46:54 +05:30
dvvvvvv
8e709f0ad9 Revert "use as_derf() instead of .map(~as_str())"
This function has been available since Rust 1.40.
2020-05-31 16:46:54 +05:30
dvvvvvv
366f0c3084 use as_derf() instead of .map(~as_str()) 2020-05-31 16:46:54 +05:30
dvvvvvv
9315eec59c cargo fmt 2020-05-31 16:46:54 +05:30
dvvvvvv
ace04d6b39 use name as file name when file name None 2020-05-31 16:46:54 +05:30
dvvvvvv
f39162dba9 revoke current path name 2020-05-31 16:46:54 +05:30
dvvvvvv
42e092b04a make not using canonical path when make parent path 2020-05-31 16:46:54 +05:30
dvvvvvv
a74f0be1c7 remove unused imports 2020-05-31 16:46:54 +05:30
dvvvvvv
7e773d9f5c cargo fmt 2020-05-31 16:46:54 +05:30
dvvvvvv
70aea2947b remove canonicalize in relative_name function and add None Display Option 2020-05-31 16:46:54 +05:30
dvvvvvv
00e4f04eec add path import to windows utility 2020-05-31 16:46:54 +05:30
dvvvvvv
e01238c09d change parameter of windows file permission utility function 2020-05-31 16:46:54 +05:30
dvvvvvv
218a867570 print . when path is same with base path 2020-05-31 16:46:54 +05:30
dvvvvvv
c404020e17 replace icon concat with format 2020-05-31 16:46:54 +05:30
dvvvvvv
08133b4ebb remove redundent edits 2020-05-31 16:46:54 +05:30
dvvvvvv
3141278c65 add relative path function 2020-05-31 16:46:54 +05:30
dvvvvvv
746a929ebf remove current/parent display option 2020-05-31 16:46:54 +05:30
dvvvvvv
708a6f5dc1 create display option of name 2020-05-31 16:46:54 +05:30
dvvvvvv
79adfff370 remove name property from Name struct 2020-05-31 16:46:54 +05:30
Jay
2107785d14 add wmv/wma icons and some playlist icons 2020-05-31 14:46:08 +05:30
dvvvvvv
517c6b6e72 remove closure 2020-05-31 14:08:19 +05:30
Hugo Osvaldo Barrera
fb931b5c9e One lock icon to rule them all 2020-05-03 12:16:34 +02:00
Hugo Osvaldo Barrera
0784b6bda1 Fix the icon for "ini"
ini files are config files (they're a standard in the Python world,
though definitely not exclusive to it).

For some reason, the previous mapping was a Windows logo, though,
ironically, much of the tooling that uses this file format is
*nix-specific.

Using a more generic icon for this.
2020-05-03 12:16:34 +02:00
Hugo Osvaldo Barrera
57b971515b Add a specific icons for poetry.lock
This file is a lockfile for poetry, a python dependency manager. It's
kinda like what cargo is to rust, but for python.
2020-05-03 12:16:34 +02:00
Andrew Chin
47d21ba4af Remove unneeded import to make clippy happy 2020-04-29 09:25:18 +05:30
zwPapEr
04129e8624 *: 🎨 add newline to each print error 2020-04-07 12:25:11 +05:30
zwPapEr
a017a3d054 fix err description deprecated 2020-04-07 12:25:11 +05:30
zwPapEr
645be4a668 delete fs canonicalize for show broken softlink without error
fix https://github.com/Peltoche/lsd/issues/72
2020-04-07 12:25:11 +05:30
jpda
ad25edcd7e added csharp, sln and razor icons 2020-01-22 19:18:06 +05:30
zwPapEr
d30f375078 revert the match to if else for blocks 2020-01-11 14:17:44 +05:30
zwPapEr
4e50ea2b55 inode: 🎨 update the inode help msg 2020-01-11 14:17:44 +05:30
zwPapEr
7ca7290e23 args/inode: 🔨 inode work with long 2020-01-11 14:17:44 +05:30
zwPapEr
11d10caf0f args: add inode(i) args for showing inode,name 2020-01-11 14:17:44 +05:30
zwPapEr
1af45a10e8 inode: 🎨 use option for inode, and two color for valid or not 2020-01-11 14:17:44 +05:30
zwPapEr
d9b68ccd10 test: 🔨 fix test after delete default, add inode windows test 2020-01-11 14:17:44 +05:30
zwPapEr
37a97353a1 inode: 🔨 using - for not supported windows inode 2020-01-11 14:17:44 +05:30
zwPapEr
da2e2081e3 test: 🎨 fix clippy style and tests, add an inode test
inode: 🔨 only get inode on unix, return 0 for windows
2020-01-11 14:17:44 +05:30
zwPapEr
0ebb39d60c impl showing inode by setting blocks
working on https://github.com/Peltoche/lsd/issues/276
2020-01-11 14:17:44 +05:30
Pierre Peltier
87e87d87cd Do not panic if the pipes a closed before all the output is written 2020-01-07 16:40:58 +01:00
dvvvvvv
f1fed05413 squeeze if-branches in date validation method 2019-12-16 16:41:50 +05:30
dvvvvvv
58d44a6450 change string literal into char literal 2019-12-16 16:41:50 +05:30
dvvvvvv
e6ee773277 add date validation message 2019-12-16 16:41:50 +05:30
dvvvvvv
50cf660567 change test parse to validation function 2019-12-16 16:41:50 +05:30
dvvvvvv
698bc2ef3b add date formatting validation 2019-12-16 16:41:50 +05:30
dvvvvvv
c4c9ee01f4 add date formatting feature 2019-12-16 16:41:50 +05:30
Pierre Peltier
200c5d2c68 Fix the spacing rules between the grid and online layout 2019-12-06 11:35:03 +05:30
Pierre Peltier
f344f42bfe Fix the tests and avoid a regression 2019-12-06 11:35:03 +05:30
Pierre Peltier
80ab697fb9 Fix the spacing, following the @meain recomandations 2019-12-06 11:35:03 +05:30
Pierre Peltier
d031c4b192 Revert the two space separator 2019-12-06 11:35:03 +05:30
Pierre Peltier
75f413ae8a Fix the tests about the name format 2019-12-06 11:35:03 +05:30
Pierre Peltier
53ad81f006 Fix the name and icon spacing 2019-12-06 11:35:03 +05:30
Pierre Peltier
7c0bdb6b6a Fix the display tree with the -l flag 2019-12-06 11:35:03 +05:30
Pierre Peltier
e4342f86d1 Remove the SizeUnit padding calculation
This padding calculation is not more required because the right padding
is handled by the term_grid package.

I hope be able to remove the left padding once I had push some changes
into the term_grid package.
2019-12-06 11:35:03 +05:30
Pierre Peltier
7ead8aec4e Remove the --prefix-indent flag
This flag is not more possible with the term_grid layout tool
2019-12-06 11:35:03 +05:30
Pierre Peltier
27f8fd3c6f Run clippy 2019-12-06 11:35:03 +05:30
Pierre Peltier
c7236ea04b Remove the "name-with-symlink" flag 2019-12-06 11:35:03 +05:30
Pierre Peltier
524ce6ba71 Fix the tests 2019-12-06 11:35:03 +05:30
Pierre Peltier
6064fc3b65 Handle the no-symlink flag 2019-12-06 11:35:03 +05:30
Pierre Peltier
41fd5a5b2a Use the term_grid package for the output of tree 2019-12-06 11:35:03 +05:30
Pierre Peltier
6ca2bd948d Merge the display functions 2019-12-06 11:35:03 +05:30
Pierre Peltier
f6c3e68463 Remove some unused stuff 2019-12-06 11:35:03 +05:30
Pierre Peltier
5b51b6cb94 Use the term_grid for the one line layout 2019-12-06 11:35:03 +05:30
Pierre Peltier
03adf997cc Remove the short/long output and use only the blocks 2019-12-06 11:35:03 +05:30
Pierre Peltier
2ee9f8b46a Fix the size tests 2019-12-06 11:35:03 +05:30
Pierre Peltier
8b8c776eaa Remove the not more used PadingRules struct 2019-12-06 11:35:03 +05:30
Pierre Peltier
8d9bcc3910 Avoid the meta vector copy 2019-12-06 11:35:03 +05:30
Pierre Peltier
61e2e88d8e Handle the block padding in a generic way 2019-12-06 11:35:03 +05:30
Pierre Peltier
f3481ceef6 Split the rendering of size parts 2019-12-06 11:35:03 +05:30
Pierre Peltier
3eaf763745 Split the size value and the size unit
This will allow to handle all the block in a generic way
2019-12-06 11:35:03 +05:30
abazylewicz
76aa327bb7 Depth args parsing compatible with Rust 1.31 2019-12-05 11:43:01 +05:30
abazylewicz
939e9008bb Allow usage of multiple 'depth' arguments 2019-12-05 11:43:01 +05:30
Roy Ivy III
3b5f1c0903 refactor ~ fix cargo clippy complaints 2019-12-04 11:09:11 +01:00
Roy Ivy III
a3b162202a refactor/polish ~ fix cargo fmt complaints 2019-12-04 11:09:11 +01:00
Cedric Staniewski
9c3db9b838 Display correct permissions for files with setuid or setgid attributes 2019-11-14 15:13:42 +01:00
optikfluffel
c4d5f5ea0b add Elm Icon for .elm files 2019-11-01 15:25:10 +05:30
JiNova
225b642b13 added elixir icon (ex, exs files) 2019-10-28 14:10:36 +05:30
Sumit Sahrawat
c0fc2380d9 Clarify help message string 2019-10-23 10:46:03 +02:00
Sumit Sahrawat
990eb6146d Resolve PR comments 2019-10-23 10:46:03 +02:00
Sumit Sahrawat
b5e13f25c7 Match ignore-glob(s) against name instead of path 2019-10-23 10:46:03 +02:00
Sumit Sahrawat
148c78d418 Fix #275: Implement -I/--ignore-glob 2019-10-23 10:46:03 +02:00
Seth Junot
58a503505d Selected icons for special Unix file types 2019-09-03 20:56:01 +05:30
Abin Simon
510f91e801 let lscolors apply default colors if LS_COLORS not defined 2019-09-03 16:35:14 +02:00
Aaron Lichtman
9086628855 Remove TODO 2019-09-02 15:04:03 +02:00
Aaron Lichtman
b19e54e3ab Change flag to --prefix-indent 2019-09-02 15:04:03 +02:00
Aaron Lichtman
66eb8532c2 Add indent flag.
Fix #22. For some reason this breaks file icon rendering?
2019-09-02 15:04:03 +02:00
Abin Simon
ffcadc1332 fix regression for flag -a from #245 2019-07-31 16:18:35 +02:00
Sen Jiang
939aba8c61 Add .gitattributes and .gitmodules 2019-07-31 15:12:37 +05:30
Peltoche
a1876912a7 Remove a regression buf removing the icons when the tty is available
This bug was add with dd10a6e543
2019-07-25 15:00:57 +02:00
thammin
af2fc02a79 Should get meta by using given path.
This prevent symlinks to be resolved.
2019-07-22 11:00:09 +02:00
Philipp Mildenberger
d8ea949690 changed the constructors in the tests for Size to the 'new' method 2019-07-17 10:27:59 +00:00
Philipp Mildenberger
744efce1b8 added a total-size flag, that calculates the total size of directories recursively 2019-07-17 10:27:59 +00:00
Philipp Mildenberger
3facd44840 refactored 'Size' to only contain bytes. The unit is calculated only when needed. Added a new --size option 'bytes' to display the filesize in bytes (without unit) this is the default of ls 2019-07-17 10:27:59 +00:00
Sag0Sag0
cb1de67261 Fix platforms specific stuff 2019-06-21 16:33:59 +02:00
Sag0Sag0
79ebe268f2 Fix typo 2019-06-21 16:33:59 +02:00
Sag0Sag0
dd10a6e543 Fixed to not include icons when running on tty 2019-06-21 16:33:59 +02:00
thammin
ca81a3e4b8 Take into account the DirOrderFlag when doing size sorting 2019-06-21 11:25:13 +05:30
Abin Simon
f1275b0e60 fix all spacing issues 2019-06-18 14:44:39 +02:00
thammin
7177c187da should return 0 length when not showing indicator 2019-06-18 14:25:06 +05:30
thammin
c3a9f9c62e fix name padding to include indicator's length 2019-06-18 14:25:06 +05:30
Igor Gnatenko
dfdf8a19b4 chore: Switch from tempdir to tempfile
Former is deprecated.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-06-10 16:31:12 +02:00
Abin Simon
e74b416bca remove last space from result vec 2019-06-09 13:02:05 +02:00
Abin Simon
2642544210 fix display for --tree with --long 2019-06-09 13:02:05 +02:00
Abin Simon
119ddb3aa4 fix padding of name and symlink
Will fix the issue where even the padding would have the background
color.
2019-06-09 13:02:05 +02:00
Abin Simon
e145697b4e add --no-symlink option 2019-06-09 13:02:05 +02:00
Abin Simon
4767ef8c11 fix tests 2019-06-09 13:02:05 +02:00
Abin Simon
bc05fa5f3a cleanup old code 2019-06-09 13:02:05 +02:00
Abin Simon
cf9d0794da invert name and namewithsymlink 2019-06-09 13:02:05 +02:00
Abin Simon
517445d768 fix dispaly with symlink 2019-06-09 13:02:05 +02:00
Abin Simon
8cbdde30e1 do not keep filetype as a seperate option 2019-06-09 13:02:05 +02:00
Abin Simon
61b8f5d7fd have most of it working 2019-06-09 13:02:05 +02:00
Abin Simon
86d4fb8215 fix name spacing 2019-06-09 13:02:05 +02:00
Abin Simon
1e6b2c6e67 fix tests for flags as ref 2019-06-09 13:02:05 +02:00
Abin Simon
dd5e8733f2 enable only certain blocks using --blocks 2019-06-09 13:02:05 +02:00
Thomas Magalhaes
3cb41aff69 core: code-cleanup: cleaner handling of tree layout boolean 2019-05-29 13:54:30 +05:30
Thomas Magalhaes
a4f6b4bc18 flags: allow to mix --long and --tree
Refs: #185
Closes: #204
2019-05-29 13:54:30 +05:30
Gavin Panella
edfee423a3 Fix listing of user-given arguments. 2019-05-24 17:58:09 +02:00
Glen Holcomb
89b3ca552f Fixes Cargo.lock icon 2019-05-24 11:44:13 +02:00
Helmut Januschka
265a18bb21 * add --sizesort/-S and sort by filesize
* modify display/fetch to also show folder size (they have sizes)
2019-05-21 14:40:16 +02:00
Roy Ivy III
32e0444b6f add portable command line wildcard support 2019-05-21 13:24:06 +02:00
Roy Ivy III
3a2a19fcb6 fix ANSI color for Windows 10 2019-05-21 13:24:06 +02:00
Gavin Panella
016e1a0e0d Don't call read_dir() twice on the same path. 2019-05-21 12:08:10 +02:00
Gavin Panella
75648b79b0 Change Meta::from_path_recursive into recurse_into(&self). 2019-05-21 12:08:10 +02:00
Gavin Panella
303e254611 Make many structs cloneable. 2019-05-21 12:08:10 +02:00
Gavin Panella
3d8e9c1b78 Populate meta_list only with what we want to display. 2019-05-21 12:08:10 +02:00
Gavin Panella
28623cf6bd Avoid filtering the metas in the display output code. 2019-05-21 12:08:10 +02:00
Gavin Panella
20e469e804 Use another Display value, as suggested by @meain. 2019-05-21 12:08:10 +02:00
Gavin Panella
65b6acc58e Accept -d/--directory-only option. 2019-05-21 12:08:10 +02:00
Atanas Yankov
79416127c8 Print errors to stderr 2019-05-17 20:26:41 +02:00
Atul Bhosale
f619dc07d6 Format code using 'cargo fmt' 2019-05-17 19:59:19 +02:00
Daniel
c4505e61f8 Changed to Self keyword to satisfy clippy 2019-04-10 15:23:16 +02:00
Daniel
6569a5162e Ported icon tests to Windows 2019-04-10 15:23:16 +02:00