Skip to content

Commit

Permalink
add full path option
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-ward committed Jan 2, 2025
1 parent 5b94316 commit 82737c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file.

## [2025.1 (pending)]
### Added
- add implied . and .. folders to -a option
- implied . and .. folders to -a option
- almost all option (-A)
- full path option (-F)

## [2024.6]
### Added
Expand Down
3 changes: 2 additions & 1 deletion lsv/entry.v
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ fn make_entry(file string, dir_name string, options Options) Entry {
is_exe := !is_dir && is_executable(stat)
is_file := filetype == .regular
indicator := if is_dir && options.dir_indicator { '/' } else { '' }
name := if options.full_path { os.real_path(path) + indicator } else { file + indicator }

return Entry{
name: file + indicator
name: name
dir_name: dir_name
stat: stat
link_stat: link_stat
Expand Down
3 changes: 3 additions & 0 deletions lsv/options.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct Options {
blocked_output bool
colorize bool
dir_indicator bool
full_path bool
list_by_lines bool
long_format bool
no_dim bool
Expand Down Expand Up @@ -88,6 +89,7 @@ fn parse_args(args []string) Options {
almost_all := fp.bool('', `A`, false, 'do not list implied . and ..')
colorize := fp.bool('', `c`, false, 'color the listing')
dir_indicator := fp.bool('', `D`, false, 'append / to directories')
full_path := fp.bool('', `F`, false, 'show full path')
icons := fp.bool('', `i`, false, 'show file icon (requires nerd fonts)')
long_format := fp.bool('', `l`, false, 'long listing format (see Long Listing Options)')
with_commas := fp.bool('', `m`, false, 'list of files separated by commas')
Expand Down Expand Up @@ -156,6 +158,7 @@ fn parse_args(args []string) Options {
dir_indicator: dir_indicator
dirs_first: dirs_first
files: if files == [] { current_dir } else { files }
full_path: full_path
header: header
icons: icons
inode: inode
Expand Down

0 comments on commit 82737c2

Please sign in to comment.