46 Commits
Author SHA1 Message Date
Yash-Handa f6f6bee415 minor fixes 2020-09-16 20:01:48 +05:30
Yash-Handa 8be883a8de Added go get and Build from Source to README.md 2020-09-16 18:05:24 +05:30
Yash-Handa 3548235135 fixed a bug on list of very long file names 2020-09-16 17:16:33 +05:30
Yash-Handa e7baa8cbbd Added go.mod to .github dir 2020-09-16 13:47:41 +05:30
Yash-Handa 916334088e bumped up version to 1.3.4 2020-09-10 15:13:51 +05:30
Yash-Handa fc190fe213 Updated some images 2020-09-10 15:04:53 +05:30
Yash-Handa 325ede6a51 Added images to README.md 2020-09-10 14:40:27 +05:30
Yash-Handa 8476463bd1 added synopsis to ctw 2020-09-10 13:32:23 +05:30
Yash-Handa 66065a3e1c Add 14 linux based icons 2020-09-10 13:24:05 +05:30
Yash-Handa c6ef105c5c added some emojies to README.md 2020-09-10 12:03:04 +05:30
Yash HandaandGitHub 6ed2b350c8 Update README.md 2020-09-10 11:53:29 +05:30
Yash-Handa f8d272d2c4 Added other sections to README.md 2020-09-10 11:39:43 +05:30
Yash-Handa b93c27db79 Added TOC link to sections of README.md 2020-09-10 08:14:10 +05:30
Yash-Handa 01424c6d9d added Installation Section to README.md 2020-09-10 08:08:34 +05:30
Yash HandaandGitHub ead801831f Merge pull request #2 from Yash-Handa/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2020-09-09 11:04:29 +05:30
Yash HandaandGitHub 1041ec04a5 Create CODE_OF_CONDUCT.md 2020-09-09 11:03:36 +05:30
Yash-Handa 830934334c Added basic structure to README.md. 2020-09-09 11:00:17 +05:30
Yash-Handa 2462e8de10 Added some Badges to README.md 2020-09-09 07:00:28 +05:30
Yash-Handa 601e3567d7 Updated the man page to current version 2020-09-09 01:25:45 +05:30
Yash-Handa 13a45eb843 Updated pre-commit hook for help2man 2020-09-09 01:23:31 +05:30
Yash-Handa e0b7546408 Bumped up version to 1.3.3 2020-09-09 01:20:54 +05:30
Yash-Handa 1b719af25b removed pre-push git hook in favour of goreleaser 2020-09-09 01:18:48 +05:30
Yash-Handa 8606cb53e0 Added .deb and .rpm packages 2020-09-09 01:17:30 +05:30
Yash-Handa 7e1e31f87f Integrated goreleaser with github 2020-09-08 23:44:38 +05:30
Yash-Handa 8f2e99cccd Updated gorelease pipeline 2020-09-08 23:11:52 +05:30
Yash-Handa a59d69ec3a Merge branch 'master' of github.com:Yash-Handa/logo-ls 2020-09-08 23:02:17 +05:30
Yash-Handa f776e08b70 Added basic goreleaser settings 2020-09-08 23:02:09 +05:30
Yash HandaandGitHub 28797b6281 Update README.md 2020-09-08 04:50:16 +05:30
Yash-Handa 60585a6a50 Added man page. 2020-09-07 13:48:43 +05:30
Yash HandaandGitHub 6ebebf05d6 Update README.md 2020-09-07 11:42:52 +05:30
Yash-Handa ba0f74c973 updated README.md 2020-09-07 11:41:15 +05:30
Yash-Handa 43b0e86ef2 Updated README.md 2020-09-07 06:54:19 +05:30
Yash-Handa 3c630eb4e5 Updated readme.md 2020-09-07 06:52:51 +05:30
Yash-Handa ffcaafbc27 Added pics to README.md 2020-09-07 01:02:12 +05:30
Yash HandaandGitHub 7d58031d73 Update README.md 2020-09-07 00:02:20 +05:30
Yash HandaandGitHub 8f3981f6e0 Update README.md 2020-09-06 23:57:04 +05:30
Yash-Handa 31c6c7aa96 Added Icon-Set image 2020-09-06 23:48:21 +05:30
Yash-Handa 1a227b5054 Using brailEmpty (U+2800) for spaces. 2020-09-06 22:02:55 +05:30
Yash-Handa b600103952 Added dir icons 2020-09-06 21:54:53 +05:30
Yash-Handa aa74d23907 Integrated Icons 2020-09-06 17:35:07 +05:30
Yash-Handa 0af9fd30e2 Added 200+ icons for 430+ ext and 330+ file names 2020-09-06 02:36:03 +05:30
Yash-Handa 4d775273cb tidy the module 2020-09-03 14:49:34 +05:30
Yash-Handa 474402d4f3 Added Complete git support !! 2020-09-03 14:45:31 +05:30
Yash-Handa 38d12c73ab Added git support to long and 1 format 2020-09-02 14:39:00 +05:30
Yash-Handa 8a44a87f95 Added basic git support 2020-09-02 14:31:49 +05:30
Yash-Handa 31972dd18f Added basic git support 2020-09-02 14:30:33 +05:30
41 changed files with 2750 additions and 146 deletions
+9 -1
View File
@@ -1,9 +1,17 @@
#!/bin/bash
# build the binery
go build
# Update HELP.md file
echo -e "\`\`\`txt" > HELP.md
go run . -? >> HELP.md
./logo-ls -? >> HELP.md
echo -e "\`\`\`" >> HELP.md
exec git add HELP.md
# Update logo-ls.1.gz
exec help2man -N -I logo-ls.h2m -o logo-ls.1 ./logo-ls
exec gzip -f logo-ls.1
exec git add logo-ls.1.gz
exit 0
+35 -35
View File
@@ -1,43 +1,43 @@
#!/bin/sh
# #!/bin/sh
R_NAME=$1
R_URL=$2
# R_NAME=$1
# R_URL=$2
error_exit()
{
if [ "$?" != "0" ]; then
nl=$'\n'
echo "$1""$nl""$2""$nl""$nl""Aborting push to ""$R_NAME"" (""$R_URL"")" 1>&2
exit 1
fi
}
# error_exit()
# {
# if [ "$?" != "0" ]; then
# nl=$'\n'
# echo "$1""$nl""$2""$nl""$nl""Aborting push to ""$R_NAME"" (""$R_URL"")" 1>&2
# exit 1
# fi
# }
# Build binary for variety of arch
# linux amd64
ERROR=$(go env -w GOOS=linux GOARCH=amd64 2>&1 > /dev/null)
error_exit "Cannot set GOOS=linux and GOARCH=amd64:" "$ERROR"
ERROR=$(go build -o build/logo-ls-linux-amd64 2>&1 > /dev/null)
error_exit "Cannot build logo-ls-linux-amd64:" "$ERROR"
# # Build binary for variety of arch
# # linux amd64
# ERROR=$(go env -w GOOS=linux GOARCH=amd64 2>&1 > /dev/null)
# error_exit "Cannot set GOOS=linux and GOARCH=amd64:" "$ERROR"
# ERROR=$(go build -o build/logo-ls-linux-amd64 2>&1 > /dev/null)
# error_exit "Cannot build logo-ls-linux-amd64:" "$ERROR"
# linux arm64
ERROR=$(go env -w GOOS=linux GOARCH=arm64 2>&1 > /dev/null)
error_exit "Cannot set GOOS=linux and GOARCH=arm64:" "$ERROR"
ERROR=$(go build -o build/logo-ls-linux-arm64 2>&1 > /dev/null)
error_exit "Cannot build logo-ls-linux-arm64:" "$ERROR"
# # linux arm64
# ERROR=$(go env -w GOOS=linux GOARCH=arm64 2>&1 > /dev/null)
# error_exit "Cannot set GOOS=linux and GOARCH=arm64:" "$ERROR"
# ERROR=$(go build -o build/logo-ls-linux-arm64 2>&1 > /dev/null)
# error_exit "Cannot build logo-ls-linux-arm64:" "$ERROR"
# linux 386
ERROR=$(go env -w GOOS=linux GOARCH=386 2>&1 > /dev/null)
error_exit "Cannot set GOOS=linux and GOARCH=386:" "$ERROR"
ERROR=$(go build -o build/logo-ls-linux-386 2>&1 > /dev/null)
error_exit "Cannot build logo-ls-linux-386:" "$ERROR"
# # linux 386
# ERROR=$(go env -w GOOS=linux GOARCH=386 2>&1 > /dev/null)
# error_exit "Cannot set GOOS=linux and GOARCH=386:" "$ERROR"
# ERROR=$(go build -o build/logo-ls-linux-386 2>&1 > /dev/null)
# error_exit "Cannot build logo-ls-linux-386:" "$ERROR"
# darwin amd64
ERROR=$(go env -w GOOS=darwin GOARCH=amd64 2>&1 > /dev/null)
error_exit "Cannot set GOOS=darwin and GOARCH=amd64:" "$ERROR"
ERROR=$(go build -o build/logo-ls-darwin-amd64 2>&1 > /dev/null)
error_exit "Cannot build logo-ls-darwin-amd64:" "$ERROR"
# # darwin amd64
# ERROR=$(go env -w GOOS=darwin GOARCH=amd64 2>&1 > /dev/null)
# error_exit "Cannot set GOOS=darwin and GOARCH=amd64:" "$ERROR"
# ERROR=$(go build -o build/logo-ls-darwin-amd64 2>&1 > /dev/null)
# error_exit "Cannot build logo-ls-darwin-amd64:" "$ERROR"
# reset env to default
go env -u GOOS GOARCH
# # reset env to default
# go env -u GOOS GOARCH
exit 0
# exit 0
+1
View File
@@ -0,0 +1 @@
// An empty go.mod file to refrain this dir to be distributed with the cli tool
Binary file not shown.

After

Width:  |  Height:  |  Size: 532 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

+7
View File
@@ -17,3 +17,10 @@
# Do not commit the executable
logo-ls
build/
# distribution directory
dist
# env stuff
*.env
.gh_token
+101
View File
@@ -0,0 +1,101 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
env_files:
github_token: ~/Projects/Golang_Stuff/logo-ls/.gh_token
project_name: logo-ls
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
builds:
- env:
- CGO_ENABLED=0
# supported OS
goos:
- linux
# - windows
- darwin
# supported ARCH
goarch:
- amd64
- 386
- arm64
- arm
# OS ARCH combinations to ignore
ignore:
- goos: darwin
goarch: 386
# Set the modified timestamp on the output binaries to the latest commit time.
# Required for producing Reproducible builds
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
# override archiving [default tar.gz]
format_overrides:
- goos: windows
format: zip
# wrap the content of archive in a dir
#so when extracting the content will be in a dir
wrap_in_directory: true
# files to be included in the archive + binary
files:
- LICENSE
- HELP.md
- logo-ls.1.gz
# - CHANGELOG.md
checksum:
name_template: '{{ .ProjectName }}_SHA512sums.txt'
algorithm: sha512
signs:
-
cmd: gpg2
# sign the checksum with Yash Handa (logo-ls) <yashhanda7@yahoo.com>
args: ["-u", "0xD9498B225223344C0205FDF528182066BCACCCB2", "--output", "${signature}", "--detach-sign", "${artifact}"]
artifacts: checksum
release:
github:
owner: Yash-Handa
name: logo-ls
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '(?i)update Readme.md'
nfpms:
-
file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
package_name: logo-ls
homepage: https://github.com/Yash-Handa/logo-ls
description: ls command with icons and git integration. Written in Golang
maintainer: Yash Handa <yashhanda7@yahoo.com>
license: MIT
formats:
- deb
- rpm
dependencies:
- git
recommends:
- golang
files:
"logo-ls.1.gz": "/usr/share/man/man1/logo-ls.1.gz"
+5
View File
@@ -0,0 +1,5 @@
{
"default": true,
"MD033": false,
"MD013": false
}
+76
View File
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at yashhanda7@yahoo.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
+27 -14
View File
@@ -1,14 +1,22 @@
```txt
Usage: logo-ls [-1?aAdgGhloRrSstUvVX] [-T value] [files ...]
List information about the FILEs with ICONS and GIT STATUS (the current dir
by default). Sort entries alphabetically if none of -tvSUX is specified.
Usage: logo-ls [-1?aAcdDgGhiloRrSstUvVX] [-T value] [files ...]
-1 list one file per line.
-? display this help and exit
-?, --help display this help and exit
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
-c, --disable-color
don't color icons, filenames and git status (use this to
print to a file)
-d, --directory list directories themselves, not their contents
-D, --git-status print git status of files
-g like -l, but do not list owner
-G, --no-group in a long listing, don't print group names
-h, --human-readable
with -l and -s, print sizes like 1K 234M 2G etc.
-i, --disable-icon
don't print icons of the files
-l use a long listing format
-o like -l, but do not list group information
-R, --recursive list subdirectories recursively
@@ -24,16 +32,21 @@ Usage: logo-ls [-1?aAdgGhloRrSstUvVX] [-T value] [files ...]
-X sort alphabetically by entry extension
Possible value for --time-style (-T)
ANSIC "Mon Jan _2 15:04:05 2006"
UnixDate "Mon Jan _2 15:04:05 MST 2006"
RubyDate "Mon Jan 02 15:04:05 -0700 2006"
RFC822 "02 Jan 06 15:04 MST"
RFC822Z "02 Jan 06 15:04 -0700"
RFC850 "Monday, 02-Jan-06 15:04:05 MST"
RFC1123 "Mon, 02 Jan 2006 15:04:05 MST"
RFC1123Z "Mon, 02 Jan 2006 15:04:05 -0700"
RFC3339 "2006-01-02T15:04:05Z07:00"
Kitchen "3:04PM"
Stamp "Mon Jan _2 15:04:05" [Default]
StampMilli "Jan _2 15:04:05.000"
ANSIC "Mon Jan _2 15:04:05 2006"
UnixDate "Mon Jan _2 15:04:05 MST 2006"
RubyDate "Mon Jan 02 15:04:05 -0700 2006"
RFC822 "02 Jan 06 15:04 MST"
RFC822Z "02 Jan 06 15:04 -0700"
RFC850 "Monday, 02-Jan-06 15:04:05 MST"
RFC1123 "Mon, 02 Jan 2006 15:04:05 MST"
RFC1123Z "Mon, 02 Jan 2006 15:04:05 -0700"
RFC3339 "2006-01-02T15:04:05Z07:00"
Kitchen "3:04PM"
Stamp "Mon Jan _2 15:04:05" [Default]
StampMilli "Jan _2 15:04:05.000"
Exit status:
0 if OK,
1 if minor problems (e.g., cannot access subdirectory),
2 if serious trouble (e.g., cannot access command-line argument).
```
+474 -1
View File
@@ -1,5 +1,478 @@
![OpenSource](https://img.shields.io/badge/Open%20Source-000000?style=for-the-badge&logo=github)
![go](https://img.shields.io/badge/-Written%20In%20Go-00add8?style=for-the-badge&logo=Go&logoColor=ffffff)
![cli](https://img.shields.io/badge/-Build%20for%20CLI-000000?style=for-the-badge&logo=Powershell&logoColor=ffffff)
# logo-ls
modern ls command with vscode like file logos. Written in Golang
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/Yash-Handa/logo-ls?style=flat-square)
![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/Yash-Handa/logo-ls?sort=semver&style=flat-square)
![PRs](https://img.shields.io/badge/PRs-welcome-56cc14?style=flat-square)
[![HitCount](http://hits.dwyl.com/{Yash-Handa}/{logo-ls}.svg)](http://hits.dwyl.com/{Yash-Handa}/{logo-ls})
![deb](https://img.shields.io/badge/-Deb%20Package-A81D33?style=flat-square&logo=Debian&link=https://github.com/Yash-Handa/logo-ls/releases/)
![rpm](https://img.shields.io/badge/-RPM%20Package-EE0000?style=flat-square&logo=Red-Hat&link=https://github.com/Yash-Handa/logo-ls/releases/)
![linux](https://img.shields.io/badge/-Linux%20Binary-FCC624?style=flat-square&logo=Linux&logoColor=000000&link=https://github.com/Yash-Handa/logo-ls/releases/)
![apple](https://img.shields.io/badge/-Darwin%20Binary-999999?style=flat-square&logo=Apple&logoColor=ffffff&link=https://github.com/Yash-Handa/logo-ls/releases/)
modern ls command with beautiful Icons and Git Integrations . Written in Golang
<div>
<span align="center">
<img alt="logo-ls" title="logo-ls" src="/.github/images/ls.png">
</span>
</div><br>
Command and Arguments supported are listed in [HELP.md](/HELP.md)
## Table of contents
- [Features](#features)
- [Usage](#usage)
- [Flags](#flags)
- `-1`
- `-a` (or) `--all`
- `-A` (or) `--almost-all`
- `-D` (or) `--git-status`
- `-l`, `-o`, `-g`, `-G`
- `-R` (or) `--recursive`
- `-?` (or) `--help`
- Sorting:
- `-t`, `-S`, `-X`, `-U`, `-v` and `-r` (`--reverse`)
- `-T` (or) `--time-style=value`
- `-i` (or) `--disable-icon`
- `-c` (or) `--disable-color`
- [Combination of flags](#combination-of-flags)
- [Multiple Files and Directories](#multiple-files-and-directories)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Debian (.deb package)](#debian-deb-package)
- [Red Hat (.rpm package)](#red-hat-rpm-package)
- [MacOS (Darwin)](#macos-darwin)
- [Linux](#linux)
- [go get](#go-get)
- [Build from Source](#build-from-source)
- [Check the downloaded Resource](#check-the-downloaded-resource)
- [Recommended configurations](#recommended-configurations)
- [Updating](#updating)
- [Icon Set](#icon-set)
- [Contributing](#contributing)
- [License](#license)
## Features
[:arrow_up: TOC](#table-of-contents)
This project is build to add esthetics to ls(coreutiles) command
- Over 250+ icons :sunglasses:
- Supporting 600+ files, extensions and directories
- 16 Million, true colors supported
- Git Status Integration
- :racehorse: Near native speed. (thanks to Golang)
- Language agnostic binaries
This project is highly inspired by [ls(coreutiles)](https://www.gnu.org/software/coreutils/manual/html_node/ls-invocation.html#ls-invocation) and [color ls](https://github.com/athityakumar/colorls). The project tries to find a happy path between speed and aesthetics.
## Usage
[:arrow_up: TOC](#table-of-contents)
All supported flags can be found by using help flag `$ logo-ls -?`. The same has been provided as [HELP.md](/HELP.md).
The project also has its manpage which can be accessed by `man logo-ls`
### Flags
Almost all flags are same as that of the classic ls command and behave similarly. The project can be used as a drop-in replacement for the ls(coreutiles)
- With `-1`: List one entry per line
<div>
<span align="center">
<img alt="logo-ls -1" title="logo-ls -1" src="/.github/images/ls-1.png">
</span>
</div><br>
- With `-a` (or) `--all` : Does not ignore entries starting with '.'
<div>
<span align="center">
<img alt="logo-ls -a" title="logo-ls -a" src="/.github/images/ls-a.png">
</span>
</div><br>
- With `-A` (or) `--almost-all` : Does not ignore entries starting with '.', except `./` and `../`
<div>
<span align="center">
<img alt="logo-ls -A" title="logo-ls -A" src="/.github/images/ls-A.png">
</span>
</div><br>
- With `-D` (or) `--git-status`: Add Git Status to the listed Files and Directory
- *Note*: As much I would love to make this the default behavior of the command but showing git status is an intensive task and may slow (a tiny bit) the command itself. If you want you can make alias to the command with `-D` applied to it.
<div>
<span align="center">
<img alt="logo-ls -D" title="logo-ls -D" src="/.github/images/ls-D.png">
</span>
</div><br>
- With `-l`: Shows in long listing format
other similar commands are:
- `-o`: like `-l`, but do not list group information
- `-g`: like `-l`, but do not list owner
- `-G` (or) `--no-group`: in a long listing, don't print group names
<div>
<span align="center">
<img alt="logo-ls -l" title="logo-ls -l" src="/.github/images/ls-l.png">
</span>
</div><br>
- With `-R` (or) `--recursive`: list subdirectories recursively
<div>
<span align="center">
<img alt="logo-ls -R" title="logo-ls -R" src="/.github/images/ls-R.png">
</span>
</div><br>
- With `-?` (or) `--help`: print the help message
- similar message can be found at [HELP.md](/HELP.md).
<div>
<span align="center">
<img alt="logo-ls -?" title="logo-ls -?" src="/.github/images/ls-h.png">
</span>
</div><br>
- **Sorting**: There are many sorting flags available [default is *alphabetic order*]
- With `-t`: sort by modification time, newest first
- With `-S`: sort by file size, largest first
- With `-X`: sort alphabetically by entry extension
- With `-U`: do not sort; list entries in directory order
- With `-v`: natural sort of (version) numbers within text
- With `-r` (or) `-reverse`: reverse order while sorting
<div>
<span align="center">
<img alt="logo-ls -X" title="logo-ls -X" src="/.github/images/ls-X.png">
</span>
</div><br>
- With `-T` (or) `--time-style=value`: set time/date format in long formats (`-l`, `-o`, `-g`). There are many options to chose from all are listed in [HELP.md](/HELP.md).
<div>
<span align="center">
<img alt="logo-ls -T" title="logo-ls -T" src="/.github/images/ls-T.png">
</span>
</div><br>
- With `-i` (or) `--disable-icon`: don't print icons of the files
<div>
<span align="center">
<img alt="logo-ls -i" title="logo-ls -i" src="/.github/images/ls-i.png">
</span>
</div><br>
- With `-c` (or) `--disable-color`: don't color icons, filenames and git status
- *Note*: use a combination of `-ic` to print output to a file `$ logo-ls -ic > t.txt`
<div>
<span align="center">
<img alt="logo-ls -c" title="logo-ls -c" src="/.github/images/ls-c.png">
</span>
</div><br>
For all available commands see manpage or [HELP.md](/HELP.md)
### Combination of flags
This project uses [getopt](https://github.com/pborman/getopt) which is a golang variant of the classic getopt utility used in ls(coreutiles). Thus any combination of flags are possible and can be used.
<div>
<span align="center">
<img alt="logo-ls with flag combination" title="logo-ls with flag combination" src="/.github/images/ls-AshDt.png">
</span>
</div><br>
### Multiple Files and Directories
You can provide multiple files and directories as command argument [default to PWD] and all will be displayed accordingly.
<div>
<span align="center">
<img alt="logo-ls with multiple files" title="logo-ls with multiple files" src="/.github/images/ls multi.png">
</span>
</div><br>
## Prerequisites
[:arrow_up: TOC](#table-of-contents)
For proper working of `logo-ls` the following should be set
- **UTF-8**: The terminal should be UTF-8 encoded (Can display Unicode-Code Point)
- **True Color** Support: The terminal can display color (16 Million Colors). for more information of True Color and supported Terminals [see here](https://gist.github.com/XVilka/8346728)
- **Nerd Fonts**: Nerd fonts are required to display Icons on screen. Basically Nerd Fonts patches your current font i.e., the last few unicode points (approx 2,824 out of 143,859) in the font are replaced with nerdy icons :nerd_face:. The complete patching process is given [here](https://github.com/ryanoasis/nerd-fonts)
## Installation
[:arrow_up: TOC](#table-of-contents)
Installation is very easy and straight forward with many options to choose from.
As of now almost all installation methods require downloading resources from the Github Release page of the project, so to be a bit more secure consider **Checking the Signature** of `logo-ls_SHA512sums.txt` text file and then use this file to check weather the resource have been tampered. This complete process is explained in more detail in [Check the downloaded Resource](#check-the-downloaded-resource) section below. (This is a recommended step and not at all required)
### Debian (.deb package)
If you are on Debian or any other Debian based distribution then installation is simple.
#### Step 1
Download the `.deb` package from [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases). Available OS_Architectures include: `i386`, `amd64`, `arm64` and `armV6`. Check your downloaded resource(s) if you like.
#### Step 2
Use the `dpkg -i path/to/downloaded/resource/` to install the binary and the manpage
### Red Hat (.rpm package)
If you are on Red Hat or any other Red Hat based distribution (like fedora) then installation is simple.
#### Step 1
Download the `.rpm` package from [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases). Available OS_Architectures include: `i386`, `amd64`, `arm64` and `armV6`. Check your downloaded resource(s) if you like.
#### Step 2
Use the `rpm -i path/to/downloaded/resource/` to install the binary and the manpage
### MacOS (Darwin)
To install `logo-ls` on darwin you have to download the binary. Support for Homebrew will come soon
#### Step 1
Download `logo-ls_Darwin_x86_64.tar.gz` from [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases).
#### Step 2
Extract a gzipped archive in the current directory.
```cmd
$ tar -xzf logo-ls_Darwin_x86_64.tar.gz
```
This will produce `logo-ls_Darwin_x86_64` directory in the current directory with the following files: `HELP.md`, `LICENSE`, `logo-ls` and `logo-ls.1.gz`
#### Step 3
Install the binary `logo-ls` by placing it in `/usr/local/bin`
```cmd
$ cd logo-ls_Darwin_x86_64
$ sudo cp logo-ls /usr/local/bin
```
#### Step 4
If you want the man page of `logo-ls` place `logo-ls.1.gz` in `/usr/share/man/man1/`
```cmd
$ sudo cp logo-ls.1.gz /usr/share/man/man1/
```
### Linux
To install `logo-ls` on any other Linux Distribution you have to download the binary.
#### Step 1
Download the `.tar.gz` archive from [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases). Available OS_Arch include: `i386`, `x86_64` (`amd64`), `arm64` and `armV6`. Check your downloaded resource(s) if you like.
#### Step 2
Extract a gzipped archive in the current directory.
```cmd
$ tar -xzf logo-ls_Linux_[ARCH].tar.gz
```
This will produce `logo-ls_Linux_[ARCH]` directory in the current directory with the following files: `HELP.md`, `LICENSE`, `logo-ls` and `logo-ls.1.gz`
#### Step 3
Install the binary `logo-ls` by placing it in `/usr/local/bin`
```cmd
$ cd logo-ls_Linux_[ARCH]
$ sudo cp logo-ls /usr/local/bin
```
#### Step 4
If you want the man page of `logo-ls` place `logo-ls.1.gz` in `/usr/share/man/man1/`
```cmd
$ sudo cp logo-ls.1.gz /usr/share/man/man1/
```
### go get
If you have [Golang](https://golang.org/) installed on your system then the `logo-ls` can be downloaded and installed using the the `go` cli tool provided by the language
#### Step 1
The `go` cli installs the binary in the directory specified by `$GOBIN` env variable [default: `~/go/bin/`]. In order to call `logo-ls` from anywhere in user-space, this directory which holds the binary must be present in `$PATH` env variable.
```cmd
$ echo $PATH
```
#### Step 2
Now simply install the binary using `go get` in home directory
```cmd
$ cd ~
$ go get github.com/Yash-Handa/logo-ls
```
### Build from Source
It is quite simple to build the command from source. You should have [Golang](https://golang.org/) installed on your system.
#### Step 1
Clone this repository.
```cmd
$ git clone https://github.com/Yash-Handa/logo-ls.git
```
#### Step 2
`cd` into the directory `logo-ls`. Then run `go mod tidy` to download the dependencies and after that `go build` to build your system specific binary
```cmd
$ cd logo-ls
$ go mod tidy
$ go build
```
the `go build` command will produce `logo-ls` executable binary in the current directory.
#### Step 3
Place the `logo-ls` executable in a directory reachable from `$PATH` env variable.
```cmd
$ sudo cp logo-ls /usr/local/bin
```
#### Step 4
If you want the man page of `logo-ls` place `logo-ls.1.gz` in `/usr/share/man/man1/`
```cmd
$ sudo cp logo-ls.1.gz /usr/share/man/man1/
```
### Check the downloaded Resource
After downloading the Resource(s) from the [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases) follow the below steps to check its authenticity.
#### Step 1
Download `logo-ls_SHA512sums.txt.sig` and `logo-ls_SHA512sums.txt` from [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases) and place them in the same directory as of the downloaded resource(s)
#### Step 2
Receive the public key of the signing party from `keyserver.ubuntu.com` server. This will add the developer's public key to your `keyring`.
```cmd
$ gpg2 --keyid-format long --keyserver keyserver.ubuntu.com --recv-keys 0x28182066bcacccb2
gpg: key 28182066BCACCCB2: "Yash Handa (logo-ls) <yashhanda7@yahoo.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
```
#### Step 3
check the signature on logo-ls_SHA512sums.txt
```cmd
$ gpg2 --keyid-format long --verify logo-ls_SHA512sums.txt.sig logo-ls_SHA512sums.txt
gpg: Signature made Tue 08 Sep 2020 10:21:52 PM IST
gpg: using RSA key D9498B225223344C0205FDF528182066BCACCCB2
gpg: Good signature from "Yash Handa (logo-ls) <yashhanda7@yahoo.com>" [ultimate]
```
A **Good** signature means that the checked file was definitely signed by the owner of the keyfile stated (if they didnt match, the signature would be reported as **BAD**)
#### Step 4
Use `logo-ls_SHA512sums.txt` file to verify the authenticity of the downloaded resource(s)
```cmd
$ sha512sum -c logo-ls_SHA512sums.txt 2>&1 | grep OK
logo-ls_Linux_x86_64.tar.gz: OK
logo-ls_Linux_arm64.tar.gz: OK
logo-ls_Darwin_x86_64.tar.gz: OK
logo-ls_Linux_i386.tar.gz: OK
logo-ls_Linux_armv6.tar.gz: OK
```
## Recommended configurations
[:arrow_up: TOC](#table-of-contents)
To add some short command (say, `ils` or `ls`) with some flag options by default, add this to your shell configuration file (`~/.bashrc`, `~/.zshrc`, etc.) :
```bash
alias ils='logo-ls'
alias ila='logo-ls -A'
alias ill='logo-ls -al'
# equivalents with Git Status on by Default
alias ilsg='logo-ls -D'
alias ilag='logo-ls -AD'
alias illg='logo-ls -alD'
```
## Updating
[:arrow_up: TOC](#table-of-contents)
As of now Updating is exactly similar as installation for [Debian (.deb package)](#debian-deb-package), [Red Hat (.rpm package)](#red-hat-rpm-package), [MacOS (Darwin)](#macos-darwin) and [Linux](#linux)
## Icon Set
[:arrow_up: TOC](#table-of-contents)
<div>
<span align="center">
<img alt="icons" title="Icon Set" src="/.github/images/icons.png">
</span>
</div><br>
## Contributing
[:arrow_up: TOC](#table-of-contents)
The project is always open to contributions. Especially for:
- More Icons
- Better ways to distribute software
- Translations to other Languages (linguistic)
## License
[:arrow_up: TOC](#table-of-contents)
The project is licensed under **MIT**. The Licence is available [here](/LICENSE).
+130 -52
View File
@@ -1,5 +1,4 @@
// custom/ in-house implementation of go's tab-writer
// because ls shows table in column major fation and according to screen size
// ctw is a custom tab writter package build to correctly display icons and colors for color-ls
package ctw
import (
@@ -8,48 +7,72 @@ import (
"math"
)
func widthsSum(w []int, p int) int {
s := 0
for _, v := range w {
s += v + p
}
s -= p
return s
type CTW struct {
d [][]string // entire data passed to ctw
nw []int // widths of each fileName
gw []int // width of each git column
sw []int //width of each size column
ic []string // color of file icon of a row
cols int // zero based no of cols (or total cols -1)
showIcon bool
termW int
}
func findMax(arr []int) int {
max := 0
for _, v := range arr {
if v >= max {
max = v
}
}
/* each file comprises of 4 columns
|<---->|<---->|<------------------>|<--------->|
| size | icon | name+ext+indicator | gitStatus |
*/
return max
func New(termW int) *CTW {
t := new(CTW)
t.cols = 3
t.termW = termW
t.nw = make([]int, 0)
t.gw = make([]int, 0)
t.sw = make([]int, 0)
t.d = make([][]string, 0)
t.ic = make([]string, 0)
return t
}
//Ctw has complexity of no. of columns x no. of files
// termW is width of the terminal
func Ctw(buf *bytes.Buffer, data []string, termW int) {
dn := len(data) // length of data slice
func (w *CTW) AddRow(args ...string) {
// length checking for args
if len(args) != w.cols+1 {
return
}
w.sw = append(w.sw, len(args[0]))
w.nw = append(w.nw, len(args[2]))
w.gw = append(w.gw, len(args[3]))
if w.showIcon == false {
w.showIcon = len(args[1]) > 0
}
w.d = append(w.d, args)
}
func (w *CTW) IconColor(c string) {
w.ic = append(w.ic, c)
}
func (w *CTW) Flush(buf *bytes.Buffer) {
dn := len(w.d)
if dn == 0 {
return
}
const pad = 2 // padding b/w columns
var lens []int // slice of lengths of each element in the data slice
widths := make([]int, 0) // slice of widths of each column (don't use because it over run once)
var prevWidths []int // accurate widths value
for _, v := range data {
lens = append(lens, len(v))
}
pad := 2
iw := make([][4]int, 0) // slice of widths of each column (don't use because it over run once)
var widths [][4]int
prevj := 0 // prevj is previous jump value (row value if you may)
// for loop runs for all possible nos. of column (1,2,3,4....)
for {
cols := len(widths) + 1
widths = append(widths, 0)
cols := len(iw) + 1
iw = append(iw, [4]int{0, 0, 0, 0})
j := int(math.Ceil(float64(dn) / float64(cols))) // jump value corresponding to cols
if prevj == j { // removes redundant calculations
continue
@@ -58,49 +81,104 @@ func Ctw(buf *bytes.Buffer, data []string, termW int) {
e := j // end of column
// find optimal widths (width of each column and total no of columns)
for i := 0; i < cols && e <= dn; i++ {
widths[i] = findMax(lens[b:e])
iw[i] = w.colW(b, e)
b, e = e, e+j
}
// for last column if last column is not complete
if e-j < dn {
widths[cols-1] = findMax(lens[e-j : dn])
iw[cols-1] = w.colW(e-j, dn)
}
prevj = j
totW := widthsSum(widths, pad) //total width of the ls block
if totW > termW {
break
} else if totW > termW/2 { // if total width of the ls block is more than half of terminal
// copy widths to prevWidths
prevWidths = make([]int, len(widths))
for i := range widths {
prevWidths[i] = widths[i]
}
}
if cols == dn { // if content comes in one line of terminal
// copy widths to prevWidths
prevWidths = make([]int, len(widths))
for i := range widths {
prevWidths[i] = widths[i]
totW := widthsSum(iw, pad) //total width of the ls block
if totW > w.termW {
// not even first iteration done print similar to logo-ls -1
if len(widths) == 0 {
widths = make([][4]int, len(iw))
for i := range iw {
widths[i] = iw[i]
}
}
break
} else if totW >= w.termW/2 { // if total width of the ls block is more than half of terminal
// copy iw to widths
widths = make([][4]int, len(iw))
for i := range iw {
widths[i] = iw[i]
}
}
if cols == dn { // if content comes in one line of terminal
// copy widths to prevWidths
widths = make([][4]int, len(iw))
for i := range iw {
widths[i] = iw[i]
}
break
}
}
// total no of rows
rows := int(math.Ceil(float64(dn) / float64(len(prevWidths))))
rows := int(math.Ceil(float64(dn) / float64(len(widths))))
// loop to write entire ls block to buffer
for i := 0; i < rows; i++ {
for j := 0; j < len(prevWidths); j++ {
p := pad
for j := 0; j < len(widths); j++ {
if i+j*rows >= dn { // checks for last column if incomplete
continue
}
fmt.Fprintf(buf, "%-*s", prevWidths[j]+pad, data[i+j*rows])
if j == len(widths)-1 {
p = 0
}
w.printCell(buf, i+j*rows, widths[j])
fmt.Fprintf(buf, "%*s", p, "")
}
fmt.Fprintf(buf, "\n")
}
}
func (w *CTW) colW(b, e int) [4]int {
s, n, g := 0, 0, 0 // max od size column, name column, gitStatus column
for i := b; i < e; i++ {
if w.sw[i] > s {
s = w.sw[i]
}
if w.nw[i] > n {
n = w.nw[i]
}
if w.gw[i] > g {
g = w.gw[i]
}
}
ans := [4]int{0, 0, 0, 0}
if s > 0 {
ans[0] = s + 1
}
if w.showIcon {
ans[1] = 2
}
ans[2] = n
if g > 0 {
ans[3] = 2
}
return ans
}
func (w *CTW) printCell(buf *bytes.Buffer, i int, cs [4]int) {
if cs[0] > 0 {
fmt.Fprintf(buf, "%-*s%s", cs[0]-1, w.d[i][0], brailEmpty)
}
if w.showIcon {
fmt.Fprintf(buf, "%s%1s%s%s", w.ic[i], w.d[i][1], white, brailEmpty)
}
fmt.Fprintf(buf, "%s%-*s%s", getGitColor(w.d[i][3]), cs[2], w.d[i][2], white)
if cs[3] > 0 {
fmt.Fprintf(buf, "%s%s%1s%s", brailEmpty, getGitColor(w.d[i][3]), w.d[i][3], white)
}
}
+78
View File
@@ -0,0 +1,78 @@
package ctw
import (
"bytes"
"fmt"
)
type LongCTW struct {
d [][]string // entire data passed to ctw
c []int // widths of each column
ic []string // color of file icon of a row
cols int // zero based no of cols (or total cols -1)
}
func NewLong(cols int) *LongCTW {
t := new(LongCTW)
t.cols = cols - 1
// initialize right size slice
t.c = make([]int, cols)
t.d = make([][]string, 0)
t.ic = make([]string, 0)
return t
}
func (l *LongCTW) AddRow(args ...string) {
// add length checking for args
if len(args) != l.cols+1 {
return
}
for i, v := range args {
if l.c[i] < len(v) {
l.c[i] = len(v)
}
}
l.d = append(l.d, args)
}
func (l *LongCTW) IconColor(c string) {
l.ic = append(l.ic, c)
}
func (l *LongCTW) Flush(buf *bytes.Buffer) {
var skipCol int = 0
for i, v := range l.c {
if v == 0 {
skipCol |= 1 << i
}
}
// explicitly setting git column to 1
l.c[l.cols] = 1
// explicitly setting icon column to 2
l.c[l.cols-2] = 1
for i, r := range l.d {
f := true
for j, c := range r {
if (1<<j)&skipCol > 0 {
continue
}
if f == false {
fmt.Fprintf(buf, "%s", brailEmpty)
}
if j == l.cols-2 {
fmt.Fprintf(buf, "%s%*s%s", l.ic[i], l.c[j], c, white)
} else if j >= l.cols-1 && (1<<l.cols)&skipCol == 0 {
color := getGitColor(r[l.cols])
fmt.Fprintf(buf, "%s%-*s%s", color, l.c[j], c, white)
} else {
fmt.Fprintf(buf, "%-*s", l.c[j], c)
}
f = false
}
fmt.Fprintln(buf)
}
}
+44
View File
@@ -0,0 +1,44 @@
package ctw
import "strings"
var (
white string = "\033[38;2;255;255;255m"
green string = "\033[38;2;055;183;021m"
brown string = "\033[38;2;192;154;107m"
brailEmpty string = "\u2800"
)
func DisplayColor(b bool) {
if b == false {
white = ""
green = ""
brown = ""
}
}
func DisplayBrailEmpty(b bool) {
if b == false {
brailEmpty = " "
}
}
func getGitColor(gitStatus string) string {
switch strings.Trim(gitStatus, " ") {
case "":
return white
case "U":
return green
default:
return brown
}
}
func widthsSum(w [][4]int, p int) int {
s := 0
for _, v := range w {
s += v[0] + v[1] + v[2] + v[3] + p
}
s -= p
return s
}
+72 -23
View File
@@ -11,7 +11,6 @@ import (
"sort"
"strings"
"syscall"
"text/tabwriter"
"time"
"github.com/Yash-Handa/logo-ls/ctw"
@@ -25,6 +24,10 @@ type file struct {
modeBits uint32
owner, group string // use syscall package
blocks int64 // blocks required by the file multiply buy 512 to get block size
// 'U'-> untracked file 'M'-> Modified file '●'-> modified dir ' '-> Not Updated/ not in git repo
gitStatus string
icon string
iconColor string
}
type dir struct {
@@ -46,11 +49,21 @@ func newDir(d *os.File) (*dir, error) {
// filing current dir info
t.info = new(file)
t.info.name = "."
if curDir {
ds, err := d.Stat()
if err != nil {
return nil, err
ds, err := d.Stat()
if err != nil {
return nil, err
}
// getting Git Status of the entire repository
var gitRepoStatus map[string]string // could be nil
if flagVector&flag_D > 0 {
gitRepoStatus = getFilesGitStatus(d.Name()) // returns map or nil
if len(gitRepoStatus) == 0 {
gitRepoStatus = nil
}
}
if curDir {
t.info.size = ds.Size()
t.info.modTime = ds.ModTime()
if long {
@@ -63,6 +76,12 @@ func newDir(d *os.File) (*dir, error) {
t.info.blocks = s.Blocks
}
}
if flagVector&flag_i == 0 {
t.info.icon = iDef["diropen"].getGlyph()
if flagVector&flag_c == 0 {
t.info.iconColor = iDef["diropen"].getColor(1)
}
}
}
// don't fill files info if the -d flag is passed
@@ -94,6 +113,22 @@ func newDir(d *os.File) (*dir, error) {
f.blocks = s.Blocks
}
}
if flagVector&flag_i == 0 {
f.icon, f.iconColor = getIcon(f.name, f.ext, f.indicator)
if flagVector&flag_c != 0 {
f.iconColor = ""
}
}
if gitRepoStatus != nil {
if v.IsDir() {
f.gitStatus = gitRepoStatus[v.Name()+"/"]
} else {
f.gitStatus = gitRepoStatus[v.Name()]
}
}
t.files = append(t.files, f)
if v.IsDir() {
t.dirs = append(t.dirs, name+"/")
@@ -128,6 +163,12 @@ func newDir(d *os.File) (*dir, error) {
t.parent.blocks = s.Blocks
}
}
if flagVector&flag_i == 0 {
t.parent.icon = iDef["diropen"].getGlyph()
if flagVector&flag_c == 0 {
t.parent.iconColor = iDef["diropen"].getColor(1)
}
}
t.files = append(t.files, t.parent)
}
@@ -159,6 +200,12 @@ func newDir_ArgFiles(files []os.FileInfo) *dir {
f.blocks = s.Blocks
}
}
if flagVector&flag_i == 0 {
f.icon, f.iconColor = getIcon(f.name, f.ext, f.indicator)
if flagVector&flag_c != 0 {
f.iconColor = ""
}
}
t.files = append(t.files, f)
}
return t
@@ -183,7 +230,7 @@ func newDirs_Recussion(d *os.File) {
temp[i] = filepath.Join(d.Name(), v)
}
for _, v := range temp {
fmt.Printf("\n%s:\n", v)
fmt.Printf("\n%s:\n", openDir+v)
f, err := os.Open(v)
if err != nil {
log.Printf("cannot access %q: %v\n", v, err)
@@ -207,38 +254,40 @@ func (d *dir) print() *bytes.Buffer {
}
buf := bytes.NewBuffer([]byte(""))
var w *tabwriter.Writer
switch {
case flagVector&(flag_l|flag_o|flag_g) > 0:
w = tabwriter.NewWriter(buf, 0, 0, 1, ' ', tabwriter.DiscardEmptyColumns)
fmtStr := "%s\t%s\t%s\t%s\t%s\t%s\t\n"
w := ctw.NewLong(9)
for _, v := range d.files {
if flagVector&flag_s > 0 {
fmt.Fprintf(w, "%s\t", getSizeInFormate(v.blocks*512))
w.AddRow(getSizeInFormate(v.blocks*512), v.mode, v.owner, v.group, getSizeInFormate(v.size), v.modTime.Format(timeFormate), v.icon, v.name+v.ext+v.indicator, v.gitStatus)
} else {
w.AddRow("", v.mode, v.owner, v.group, getSizeInFormate(v.size), v.modTime.Format(timeFormate), v.icon, v.name+v.ext+v.indicator, v.gitStatus)
}
fmt.Fprintf(w, fmtStr, v.mode, v.owner, v.group, getSizeInFormate(v.size), v.modTime.Format(timeFormate), v.name+v.ext+v.indicator)
w.IconColor(v.iconColor)
}
w.Flush()
w.Flush(buf)
case flagVector&flag_1 > 0:
w = tabwriter.NewWriter(buf, 0, 0, 1, ' ', tabwriter.DiscardEmptyColumns)
w := ctw.NewLong(4)
for _, v := range d.files {
if flagVector&flag_s > 0 {
fmt.Fprintf(w, "%s\t", getSizeInFormate(v.blocks*512))
w.AddRow(getSizeInFormate(v.blocks*512), v.icon, v.name+v.ext+v.indicator, v.gitStatus)
} else {
w.AddRow("", v.icon, v.name+v.ext+v.indicator, v.gitStatus)
}
fmt.Fprintf(w, "%s\t\n", v.name+v.ext+v.indicator)
w.IconColor(v.iconColor)
}
w.Flush()
w.Flush(buf)
default:
// w = tabwriter.NewWriter(buf, 0, 0, 2, ' ', tabwriter.DiscardEmptyColumns)
temp := make([]string, len(d.files))
for i, v := range d.files {
s := ""
w := ctw.New(terminalWidth)
for _, v := range d.files {
if flagVector&flag_s > 0 {
s = getSizeInFormate(v.blocks*512) + " "
w.AddRow(getSizeInFormate(v.blocks*512), v.icon, v.name+v.ext+v.indicator, v.gitStatus)
} else {
w.AddRow("", v.icon, v.name+v.ext+v.indicator, v.gitStatus)
}
temp[i] = s + v.name + v.ext + v.indicator
w.IconColor(v.iconColor)
}
ctw.Ctw(buf, temp, terminalWidth)
w.Flush(buf)
}
return buf
}
+39
View File
@@ -146,3 +146,42 @@ func getSizeInFormate(b int64) string {
return fmt.Sprintf("%.1f%c",
float64(b)/float64(div), "KMGTPE"[exp])
}
func getIcon(name, ext, indicator string) (icon, color string) {
var i *iInfo
var ok bool
switch indicator {
case "/":
// send dir related stuff
i, ok = Icon_Dir[strings.ToLower(name+ext)]
if ok {
break
}
if len(name) == 0 || '.' == name[0] {
i = iDef["hiddendir"]
break
}
i = iDef["dir"]
case "*":
// send executable related stuff
i = iDef["exe"]
default:
// send file related stuff
i, ok = Icon_FileName[strings.ToLower(name+ext)]
if ok {
break
}
i, ok = Icon_Ext[strings.ToLower(strings.TrimPrefix(ext, "."))]
if ok {
break
}
if len(name) == 0 || '.' == name[0] {
i = iDef["hiddenfile"]
break
}
i = iDef["file"]
}
return i.getGlyph(), i.getColor(1)
}
+70
View File
@@ -0,0 +1,70 @@
package main
import (
"path/filepath"
"strings"
"github.com/go-git/go-git/v5"
)
func getRepoStatus(path string) (git.Status, string, error) {
op := git.PlainOpenOptions{DetectDotGit: true}
r, err := git.PlainOpenWithOptions(path, &op)
if err != nil {
return nil, "", err
}
w, err := r.Worktree()
if err != nil {
return nil, "", err
}
ws, err := w.Status()
if err != nil {
return nil, "", err
}
return ws, w.Filesystem.Root(), nil
}
func getFilesGitStatus(p string) map[string]string {
gitRepo, gitRoot, err := getRepoStatus(p)
if err != nil || len(gitRepo) == 0 {
return nil
}
pAbs, err := filepath.Abs(p)
if err != nil {
return nil
}
t := make(map[string]string)
for i, v := range gitRepo {
i = gitFilePath(gitRoot+"/"+i, pAbs+"/")
if i == "" {
continue
}
dirs := strings.SplitAfter(i, "/")
d := ""
for j, seg := range dirs {
if j == len(dirs)-1 {
if v.Worktree == '?' {
t[i] = "U"
} else {
t[i] = string(v.Worktree)
}
} else {
d += seg
t[d] = "●"
}
}
}
return t
}
func gitFilePath(gitpath, dirpath string) string {
if strings.HasPrefix(gitpath, dirpath) {
return strings.TrimPrefix(gitpath, dirpath)
}
return ""
}
+1
View File
@@ -3,6 +3,7 @@ module github.com/Yash-Handa/logo-ls
go 1.15
require (
github.com/go-git/go-git/v5 v5.1.0
github.com/pborman/getopt/v2 v2.0.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
)
+72
View File
@@ -1,10 +1,82 @@
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM=
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc=
github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk=
github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pborman/getopt/v2 v2.0.0 h1:Tn8XVmhb93Wbc346Tk4P6KutfpMVp+iztUzkZrTSyB4=
github.com/pborman/getopt/v2 v2.0.0/go.mod h1:4NtW75ny4eBw9fO1bhtNdYTlZKYX5/tBLtsOpwKIKd0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+61
View File
@@ -0,0 +1,61 @@
package main
var Icon_Dir = map[string]*iInfo{
"config": iSet["dir-config"],
".config": iSet["dir-config"],
"configs": iSet["dir-config"],
"configuration": iSet["dir-config"],
"configurations": iSet["dir-config"],
"settings": iSet["dir-config"],
".settings": iSet["dir-config"],
"META-INF": iSet["dir-config"],
"controller": iSet["dir-controller"],
"controllers": iSet["dir-controller"],
"service": iSet["dir-controller"],
"services": iSet["dir-controller"],
"provider": iSet["dir-controller"],
"providers": iSet["dir-controller"],
".git": iSet["dir-git"],
"githooks": iSet["dir-git"],
".githooks": iSet["dir-git"],
"submodules": iSet["dir-git"],
".submodules": iSet["dir-git"],
".github": iSet["dir-github"],
"node_modules": iSet["dir-npm"],
"include": iSet["dir-include"],
"includes": iSet["dir-include"],
"_includes": iSet["dir-include"],
"import": iSet["dir-import"],
"imports": iSet["dir-import"],
"imported": iSet["dir-import"],
"uploads": iSet["dir-upload"],
"upload": iSet["dir-upload"],
"downloads": iSet["dir-download"],
"download": iSet["dir-download"],
"auth": iSet["dir-secure"],
"authentication": iSet["dir-secure"],
"secure": iSet["dir-secure"],
"security": iSet["dir-secure"],
"cert": iSet["dir-secure"],
"certs": iSet["dir-secure"],
"certificate": iSet["dir-secure"],
"certificates": iSet["dir-secure"],
"ssl": iSet["dir-secure"],
"images": iSet["dir-images"],
"image": iSet["dir-images"],
"pics": iSet["dir-images"],
"pic": iSet["dir-images"],
"pictures": iSet["dir-images"],
"picture": iSet["dir-images"],
"img": iSet["dir-images"],
"icons": iSet["dir-images"],
"icon": iSet["dir-images"],
"ico": iSet["dir-images"],
"screenshot": iSet["dir-images"],
"screenshots": iSet["dir-images"],
".env": iSet["dir-environment"],
".environment": iSet["dir-environment"],
"env": iSet["dir-environment"],
"environment": iSet["dir-environment"],
"environments": iSet["dir-environment"],
}
+536
View File
@@ -0,0 +1,536 @@
package main
var Icon_Ext = map[string]*iInfo{
"htm": iSet["html"],
"html": iSet["html"],
"xhtml": iSet["html"],
"html_vm": iSet["html"],
"asp": iSet["html"],
"jade": iSet["pug"],
"pug": iSet["pug"],
"md": iSet["markdown"],
"markdown": iSet["markdown"],
"rst": iSet["markdown"],
"blink": iSet["blink"],
"css": iSet["css"],
"scss": iSet["sass"],
"sass": iSet["sass"],
"less": iSet["less"],
"json": iSet["json"],
"tsbuildinfo": iSet["json"],
"json5": iSet["json"],
"jsonl": iSet["json"],
"ndjson": iSet["json"],
"jinja": iSet["jinja"],
"jinja2": iSet["jinja"],
"j2": iSet["jinja"],
"jinja-html": iSet["jinja"],
"sublime-project": iSet["sublime"],
"sublime-workspace": iSet["sublime"],
"yaml": iSet["yaml"],
"yaml-tmlanguage": iSet["yaml"],
"yml": iSet["yaml"],
"xml": iSet["xml"],
"plist": iSet["xml"],
"xsd": iSet["xml"],
"dtd": iSet["xml"],
"xsl": iSet["xml"],
"xslt": iSet["xml"],
"resx": iSet["xml"],
"iml": iSet["xml"],
"xquery": iSet["xml"],
"tmLanguage": iSet["xml"],
"manifest": iSet["xml"],
"project": iSet["xml"],
"png": iSet["image"],
"jpeg": iSet["image"],
"jpg": iSet["image"],
"gif": iSet["image"],
"ico": iSet["image"],
"tif": iSet["image"],
"tiff": iSet["image"],
"psd": iSet["image"],
"psb": iSet["image"],
"ami": iSet["image"],
"apx": iSet["image"],
"bmp": iSet["image"],
"bpg": iSet["image"],
"brk": iSet["image"],
"cur": iSet["image"],
"dds": iSet["image"],
"dng": iSet["image"],
"exr": iSet["image"],
"fpx": iSet["image"],
"gbr": iSet["image"],
"img": iSet["image"],
"jbig2": iSet["image"],
"jb2": iSet["image"],
"jng": iSet["image"],
"jxr": iSet["image"],
"pbm": iSet["image"],
"pgf": iSet["image"],
"pic": iSet["image"],
"raw": iSet["image"],
"webp": iSet["image"],
"eps": iSet["image"],
"afphoto": iSet["image"],
"ase": iSet["image"],
"aseprite": iSet["image"],
"clip": iSet["image"],
"cpt": iSet["image"],
"heif": iSet["image"],
"heic": iSet["image"],
"kra": iSet["image"],
"mdp": iSet["image"],
"ora": iSet["image"],
"pdn": iSet["image"],
"reb": iSet["image"],
"sai": iSet["image"],
"tga": iSet["image"],
"xcf": iSet["image"],
"js": iSet["javascript"],
"esx": iSet["javascript"],
"mj": iSet["javascript"],
"jsx": iSet["react"],
"tsx": iSet["react_ts"],
"ini": iSet["settings"],
"dlc": iSet["settings"],
"dll": iSet["settings"],
"config": iSet["settings"],
"conf": iSet["settings"],
"properties": iSet["settings"],
"prop": iSet["settings"],
"settings": iSet["settings"],
"option": iSet["settings"],
"props": iSet["settings"],
"toml": iSet["settings"],
"prefs": iSet["settings"],
"dotsettings": iSet["settings"],
"cfg": iSet["settings"],
"ts": iSet["typescript"],
"marko": iSet["markojs"],
"pdf": iSet["pdf"],
"xlsx": iSet["table"],
"xls": iSet["table"],
"csv": iSet["table"],
"tsv": iSet["table"],
"vscodeignore": iSet["vscode"],
"vsixmanifest": iSet["vscode"],
"vsix": iSet["vscode"],
"code-workplace": iSet["vscode"],
"csproj": iSet["visualstudio"],
"ruleset": iSet["visualstudio"],
"sln": iSet["visualstudio"],
"suo": iSet["visualstudio"],
"vb": iSet["visualstudio"],
"vbs": iSet["visualstudio"],
"vcxitems": iSet["visualstudio"],
"vcxproj": iSet["visualstudio"],
"pdb": iSet["database"],
"sql": iSet["mysql"],
"pks": iSet["database"],
"pkb": iSet["database"],
"accdb": iSet["database"],
"mdb": iSet["database"],
"sqlite": iSet["sqlite"],
"sqlite3": iSet["sqlite"],
"pgsql": iSet["postgresql"],
"postgres": iSet["postgresql"],
"psql": iSet["postgresql"],
"cs": iSet["csharp"],
"csx": iSet["csharp"],
"qs": iSet["qsharp"],
"zip": iSet["zip"],
"tar": iSet["zip"],
"gz": iSet["zip"],
"xz": iSet["zip"],
"br": iSet["zip"],
"bzip2": iSet["zip"],
"gzip": iSet["zip"],
"brotli": iSet["zip"],
"7z": iSet["zip"],
"rar": iSet["zip"],
"tgz": iSet["zip"],
"vala": iSet["vala"],
"zig": iSet["zig"],
"exe": iSet["exe"],
"msi": iSet["exe"],
"java": iSet["java"],
"jar": iSet["java"],
"jsp": iSet["java"],
"c": iSet["c"],
"m": iSet["c"],
"i": iSet["c"],
"mi": iSet["c"],
"h": iSet["h"],
"cc": iSet["cpp"],
"cpp": iSet["cpp"],
"cxx": iSet["cpp"],
"c++": iSet["cpp"],
"cp": iSet["cpp"],
"mm": iSet["cpp"],
"mii": iSet["cpp"],
"ii": iSet["cpp"],
"hh": iSet["hpp"],
"hpp": iSet["hpp"],
"hxx": iSet["hpp"],
"h++": iSet["hpp"],
"hp": iSet["hpp"],
"tcc": iSet["hpp"],
"inl": iSet["hpp"],
"go": iSet["go"],
"py": iSet["python"],
"pyc": iSet["python-misc"],
"whl": iSet["python-misc"],
"url": iSet["url"],
"sh": iSet["console"],
"ksh": iSet["console"],
"csh": iSet["console"],
"tcsh": iSet["console"],
"zsh": iSet["console"],
"bash": iSet["console"],
"bat": iSet["console"],
"cmd": iSet["console"],
"awk": iSet["console"],
"fish": iSet["console"],
"ps1": iSet["powershell"],
"psm1": iSet["powershell"],
"psd1": iSet["powershell"],
"ps1xml": iSet["powershell"],
"psc1": iSet["powershell"],
"pssc": iSet["powershell"],
"gradle": iSet["gradle"],
"doc": iSet["word"],
"docx": iSet["word"],
"rtf": iSet["word"],
"cer": iSet["certificate"],
"cert": iSet["certificate"],
"crt": iSet["certificate"],
"pub": iSet["key"],
"key": iSet["key"],
"pem": iSet["key"],
"asc": iSet["key"],
"gpg": iSet["key"],
"woff": iSet["font"],
"woff2": iSet["font"],
"ttf": iSet["font"],
"eot": iSet["font"],
"suit": iSet["font"],
"otf": iSet["font"],
"bmap": iSet["font"],
"fnt": iSet["font"],
"odttf": iSet["font"],
"ttc": iSet["font"],
"font": iSet["font"],
"fonts": iSet["font"],
"sui": iSet["font"],
"ntf": iSet["font"],
"mrf": iSet["font"],
"lib": iSet["lib"],
"bib": iSet["lib"],
"rb": iSet["ruby"],
"erb": iSet["ruby"],
"fs": iSet["fsharp"],
"fsx": iSet["fsharp"],
"fsi": iSet["fsharp"],
"fsproj": iSet["fsharp"],
"swift": iSet["swift"],
"ino": iSet["arduino"],
"dockerignore": iSet["docker"],
"dockerfile": iSet["docker"],
"tex": iSet["tex"],
"sty": iSet["tex"],
"dtx": iSet["tex"],
"ltx": iSet["tex"],
"pptx": iSet["powerpoint"],
"ppt": iSet["powerpoint"],
"pptm": iSet["powerpoint"],
"potx": iSet["powerpoint"],
"potm": iSet["powerpoint"],
"ppsx": iSet["powerpoint"],
"ppsm": iSet["powerpoint"],
"pps": iSet["powerpoint"],
"ppam": iSet["powerpoint"],
"ppa": iSet["powerpoint"],
"webm": iSet["video"],
"mkv": iSet["video"],
"flv": iSet["video"],
"vob": iSet["video"],
"ogv": iSet["video"],
"ogg": iSet["video"],
"gifv": iSet["video"],
"avi": iSet["video"],
"mov": iSet["video"],
"qt": iSet["video"],
"wmv": iSet["video"],
"yuv": iSet["video"],
"rm": iSet["video"],
"rmvb": iSet["video"],
"mp4": iSet["video"],
"m4v": iSet["video"],
"mpg": iSet["video"],
"mp2": iSet["video"],
"mpeg": iSet["video"],
"mpe": iSet["video"],
"mpv": iSet["video"],
"m2v": iSet["video"],
"vdi": iSet["virtual"],
"vbox": iSet["virtual"],
"vbox-prev": iSet["virtual"],
"ics": iSet["email"],
"mp3": iSet["audio"],
"flac": iSet["audio"],
"m4a": iSet["audio"],
"wma": iSet["audio"],
"aiff": iSet["audio"],
"coffee": iSet["coffee"],
"cson": iSet["coffee"],
"iced": iSet["coffee"],
"txt": iSet["document"],
"graphql": iSet["graphql"],
"gql": iSet["graphql"],
"rs": iSet["rust"],
"raml": iSet["raml"],
"xaml": iSet["xaml"],
"hs": iSet["haskell"],
"kt": iSet["kotlin"],
"kts": iSet["kotlin"],
"patch": iSet["git"],
"lua": iSet["lua"],
"clj": iSet["clojure"],
"cljs": iSet["clojure"],
"cljc": iSet["clojure"],
"groovy": iSet["groovy"],
"r": iSet["r"],
"rmd": iSet["r"],
"dart": iSet["dart"],
"as": iSet["actionscript"],
"mxml": iSet["mxml"],
"ahk": iSet["autohotkey"],
"swf": iSet["flash"],
"swc": iSet["swc"],
"cmake": iSet["cmake"],
"asm": iSet["assembly"],
"a51": iSet["assembly"],
"inc": iSet["assembly"],
"nasm": iSet["assembly"],
"s": iSet["assembly"],
"ms": iSet["assembly"],
"agc": iSet["assembly"],
"ags": iSet["assembly"],
"aea": iSet["assembly"],
"argus": iSet["assembly"],
"mitigus": iSet["assembly"],
"binsource": iSet["assembly"],
"vue": iSet["vue"],
"ml": iSet["ocaml"],
"mli": iSet["ocaml"],
"cmx": iSet["ocaml"],
"lock": iSet["lock"],
"hbs": iSet["handlebars"],
"mustache": iSet["handlebars"],
"pm": iSet["perl"],
"raku": iSet["perl"],
"hx": iSet["haxe"],
"pp": iSet["puppet"],
"ex": iSet["elixir"],
"exs": iSet["elixir"],
"eex": iSet["elixir"],
"leex": iSet["elixir"],
"erl": iSet["erlang"],
"twig": iSet["twig"],
"jl": iSet["julia"],
"elm": iSet["elm"],
"pure": iSet["purescript"],
"purs": iSet["purescript"],
"tpl": iSet["smarty"],
"styl": iSet["stylus"],
"merlin": iSet["merlin"],
"v": iSet["verilog"],
"vhd": iSet["verilog"],
"sv": iSet["verilog"],
"svh": iSet["verilog"],
"robot": iSet["robot"],
"sol": iSet["solidity"],
"yang": iSet["yang"],
"mjml": iSet["mjml"],
"tf": iSet["terraform"],
"tfvars": iSet["terraform"],
"tfstate": iSet["terraform"],
"applescript": iSet["applescript"],
"ipa": iSet["applescript"],
"cake": iSet["cake"],
"nim": iSet["nim"],
"nimble": iSet["nim"],
"apib": iSet["apiblueprint"],
"apiblueprint": iSet["apiblueprint"],
"pcss": iSet["postcss"],
"sss": iSet["postcss"],
"todo": iSet["todo"],
"nix": iSet["nix"],
"slim": iSet["slim"],
"http": iSet["http"],
"rest": iSet["http"],
"apk": iSet["android"],
"env": iSet["tune"],
"jenkinsfile": iSet["jenkins"],
"jenkins": iSet["jenkins"],
"log": iSet["log"],
"ejs": iSet["ejs"],
"djt": iSet["django"],
"pot": iSet["i18n"],
"po": iSet["i18n"],
"mo": iSet["i18n"],
"d": iSet["d"],
"mdx": iSet["mdx"],
"gd": iSet["godot"],
"godot": iSet["godot-assets"],
"tres": iSet["godot-assets"],
"tscn": iSet["godot-assets"],
"azcli": iSet["azure"],
"vagrantfile": iSet["vagrant"],
"cshtml": iSet["razor"],
"vbhtml": iSet["razor"],
"ad": iSet["asciidoc"],
"adoc": iSet["asciidoc"],
"asciidoc": iSet["asciidoc"],
"edge": iSet["edge"],
"ss": iSet["scheme"],
"scm": iSet["scheme"],
"stl": iSet["3d"],
"obj": iSet["3d"],
"ac": iSet["3d"],
"blend": iSet["3d"],
"mesh": iSet["3d"],
"mqo": iSet["3d"],
"pmd": iSet["3d"],
"pmx": iSet["3d"],
"skp": iSet["3d"],
"vac": iSet["3d"],
"vdp": iSet["3d"],
"vox": iSet["3d"],
"svg": iSet["svg"],
"vimrc": iSet["vim"],
"gvimrc": iSet["vim"],
"exrc": iSet["vim"],
"moon": iSet["moonscript"],
"iso": iSet["disc"],
"f": iSet["fortran"],
"f77": iSet["fortran"],
"f90": iSet["fortran"],
"f95": iSet["fortran"],
"f03": iSet["fortran"],
"f08": iSet["fortran"],
"tcl": iSet["tcl"],
"liquid": iSet["liquid"],
"p": iSet["prolog"],
"pro": iSet["prolog"],
"coco": iSet["coconut"],
"sketch": iSet["sketch"],
"opam": iSet["opam"],
"dhallb": iSet["dhall"],
"pwn": iSet["pawn"],
"amx": iSet["pawn"],
"dhall": iSet["dhall"],
"pas": iSet["pascal"],
"unity": iSet["shaderlab"],
"nupkg": iSet["nuget"],
"command": iSet["command"],
"dsc": iSet["denizenscript"],
"deb": iSet["debian"],
"rpm": iSet["redhat"],
"snap": iSet["ubuntu"],
"ebuild": iSet["gentoo"],
"pkg": iSet["applescript"],
"openbsd": iSet["freebsd"],
// "ls": iSet["livescript"],
// "re": iSet["reason"],
// "rei": iSet["reason"],
// "cmj": iSet["bucklescript"],
// "nb": iSet["mathematica"],
// "wl": iSet["wolframlanguage"],
// "wls": iSet["wolframlanguage"],
// "njk": iSet["nunjucks"],
// "nunjucks": iSet["nunjucks"],
// "au3": iSet["autoit"],
// "haml": iSet["haml"],
// "feature": iSet["cucumber"],
// "riot": iSet["riot"],
// "tag": iSet["riot"],
// "vfl": iSet["vfl"],
// "kl": iSet["kl"],
// "cfml": iSet["coldfusion"],
// "cfc": iSet["coldfusion"],
// "lucee": iSet["coldfusion"],
// "cfm": iSet["coldfusion"],
// "cabal": iSet["cabal"],
// "rql": iSet["restql"],
// "restql": iSet["restql"],
// "kv": iSet["kivy"],
// "graphcool": iSet["graphcool"],
// "sbt": iSet["sbt"],
// "cr": iSet["crystal"],
// "ecr": iSet["crystal"],
// "cu": iSet["cuda"],
// "cuh": iSet["cuda"],
// "def": iSet["dotjs"],
// "dot": iSet["dotjs"],
// "jst": iSet["dotjs"],
// "pde": iSet["processing"],
// "wpy": iSet["wepy"],
// "hcl": iSet["hcl"],
// "san": iSet["san"],
// "red": iSet["red"],
// "fxp": iSet["foxpro"],
// "prg": iSet["foxpro"],
// "wat": iSet["webassembly"],
// "wasm": iSet["webassembly"],
// "ipynb": iSet["jupyter"],
// "bal": iSet["ballerina"],
// "balx": iSet["ballerina"],
// "rkt": iSet["racket"],
// "bzl": iSet["bazel"],
// "bazel": iSet["bazel"],
// "mint": iSet["mint"],
// "vm": iSet["velocity"],
// "fhtml": iSet["velocity"],
// "vtl": iSet["velocity"],
// "prisma": iSet["prisma"],
// "abc": iSet["abc"],
// "lisp": iSet["lisp"],
// "lsp": iSet["lisp"],
// "cl": iSet["lisp"],
// "fast": iSet["lisp"],
// "svelte": iSet["svelte"],
// "prw": iSet["advpl_prw"],
// "prx": iSet["advpl_prw"],
// "ptm": iSet["advpl_ptm"],
// "tlpp": iSet["advpl_tlpp"],
// "ch": iSet["advpl_include"],
// "4th": iSet["forth"],
// "fth": iSet["forth"],
// "frt": iSet["forth"],
// "iuml": iSet["uml"],
// "pu": iSet["uml"],
// "puml": iSet["uml"],
// "plantuml": iSet["uml"],
// "wsd": iSet["uml"],
// "sml": iSet["sml"],
// "mlton": iSet["sml"],
// "mlb": iSet["sml"],
// "sig": iSet["sml"],
// "fun": iSet["sml"],
// "cm": iSet["sml"],
// "lex": iSet["sml"],
// "use": iSet["sml"],
// "grm": iSet["sml"],
// "imba": iSet["imba"],
// "drawio": iSet["drawio"],
// "dio": iSet["drawio"],
// "sas": iSet["sas"],
// "sas7bdat": iSet["sas"],
// "sashdat": iSet["sas"],
// "astore": iSet["sas"],
// "ast": iSet["sas"],
// "sast": iSet["sas"],
}
+406
View File
@@ -0,0 +1,406 @@
package main
var Icon_FileName = map[string]*iInfo{
".pug-lintrc": iSet["pug"],
".pug-lintrc.js": iSet["pug"],
".pug-lintrc.json": iSet["pug"],
".jscsrc": iSet["json"],
".jshintrc": iSet["json"],
"composer.lock": iSet["json"],
".jsbeautifyrc": iSet["json"],
".esformatter": iSet["json"],
"cdp.pid": iSet["json"],
".mjmlconfig": iSet["json"],
".htaccess": iSet["xml"],
".jshintignore": iSet["settings"],
".buildignore": iSet["settings"],
".mrconfig": iSet["settings"],
".yardopts": iSet["settings"],
"manifest.mf": iSet["settings"],
".clang-format": iSet["settings"],
".clang-tidy": iSet["settings"],
"go.mod": iSet["go-mod"],
"go.sum": iSet["go-mod"],
"requirements.txt": iSet["python-misc"],
"pipfile": iSet["python-misc"],
".python-version": iSet["python-misc"],
"manifest.in": iSet["python-misc"],
"gradle.properties": iSet["gradle"],
"gradlew": iSet["gradle"],
"gradle-wrapper.properties": iSet["gradle"],
"license": iSet["certificate"],
"license.md": iSet["certificate"],
"license.txt": iSet["certificate"],
"licence": iSet["certificate"],
"licence.md": iSet["certificate"],
"licence.txt": iSet["certificate"],
"unlicense": iSet["certificate"],
"unlicense.md": iSet["certificate"],
"unlicense.txt": iSet["certificate"],
".htpasswd": iSet["key"],
"gemfile": iSet["gemfile"],
"dockerfile": iSet["docker"],
"dockerfile.prod": iSet["docker"],
"dockerfile.production": iSet["docker"],
"docker-compose.yml": iSet["docker"],
"docker-compose.yaml": iSet["docker"],
"docker-compose.dev.yml": iSet["docker"],
"docker-compose.local.yml": iSet["docker"],
"docker-compose.ci.yml": iSet["docker"],
"docker-compose.override.yml": iSet["docker"],
"docker-compose.staging.yml": iSet["docker"],
"docker-compose.prod.yml": iSet["docker"],
"docker-compose.production.yml": iSet["docker"],
"docker-compose.test.yml": iSet["docker"],
".mailmap": iSet["email"],
".graphqlconfig": iSet["graphql"],
".gitignore": iSet["git"],
".gitconfig": iSet["git"],
".gitattributes": iSet["git"],
".gitmodules": iSet["git"],
".gitkeep": iSet["git"],
"git-history": iSet["git"],
".luacheckrc": iSet["lua"],
".Rhistory": iSet["r"],
"cmakelists.txt": iSet["cmake"],
"cmakecache.txt": iSet["cmake"],
"vue.config.js": iSet["vue-config"],
"vue.config.ts": iSet["vue-config"],
"nuxt.config.js": iSet["nuxt"],
"nuxt.config.ts": iSet["nuxt"],
"security.md": iSet["lock"],
"security.txt": iSet["lock"],
"security": iSet["lock"],
"vercel.json": iSet["vercel"],
".vercelignore": iSet["vercel"],
"now.json": iSet["vercel"],
".nowignore": iSet["vercel"],
"postcss.config.js": iSet["postcss"],
".postcssrc.js": iSet["postcss"],
".postcssrc": iSet["postcss"],
".postcssrc.json": iSet["postcss"],
".postcssrc.yml": iSet["postcss"],
"CNAME": iSet["http"],
"webpack.js": iSet["webpack"],
"webpack.ts": iSet["webpack"],
"webpack.base.js": iSet["webpack"],
"webpack.base.ts": iSet["webpack"],
"webpack.config.js": iSet["webpack"],
"webpack.config.ts": iSet["webpack"],
"webpack.common.js": iSet["webpack"],
"webpack.common.ts": iSet["webpack"],
"webpack.config.common.js": iSet["webpack"],
"webpack.config.common.ts": iSet["webpack"],
"webpack.config.common.babel.js": iSet["webpack"],
"webpack.config.common.babel.ts": iSet["webpack"],
"webpack.dev.js": iSet["webpack"],
"webpack.dev.ts": iSet["webpack"],
"webpack.development.js": iSet["webpack"],
"webpack.development.ts": iSet["webpack"],
"webpack.config.dev.js": iSet["webpack"],
"webpack.config.dev.ts": iSet["webpack"],
"webpack.config.dev.babel.js": iSet["webpack"],
"webpack.config.dev.babel.ts": iSet["webpack"],
"webpack.prod.js": iSet["webpack"],
"webpack.prod.ts": iSet["webpack"],
"webpack.production.js": iSet["webpack"],
"webpack.production.ts": iSet["webpack"],
"webpack.server.js": iSet["webpack"],
"webpack.server.ts": iSet["webpack"],
"webpack.client.js": iSet["webpack"],
"webpack.client.ts": iSet["webpack"],
"webpack.config.server.js": iSet["webpack"],
"webpack.config.server.ts": iSet["webpack"],
"webpack.config.client.js": iSet["webpack"],
"webpack.config.client.ts": iSet["webpack"],
"webpack.config.production.babel.js": iSet["webpack"],
"webpack.config.production.babel.ts": iSet["webpack"],
"webpack.config.prod.babel.js": iSet["webpack"],
"webpack.config.prod.babel.ts": iSet["webpack"],
"webpack.config.prod.js": iSet["webpack"],
"webpack.config.prod.ts": iSet["webpack"],
"webpack.config.production.js": iSet["webpack"],
"webpack.config.production.ts": iSet["webpack"],
"webpack.config.staging.js": iSet["webpack"],
"webpack.config.staging.ts": iSet["webpack"],
"webpack.config.babel.js": iSet["webpack"],
"webpack.config.babel.ts": iSet["webpack"],
"webpack.config.base.babel.js": iSet["webpack"],
"webpack.config.base.babel.ts": iSet["webpack"],
"webpack.config.base.js": iSet["webpack"],
"webpack.config.base.ts": iSet["webpack"],
"webpack.config.staging.babel.js": iSet["webpack"],
"webpack.config.staging.babel.ts": iSet["webpack"],
"webpack.config.coffee": iSet["webpack"],
"webpack.config.test.js": iSet["webpack"],
"webpack.config.test.ts": iSet["webpack"],
"webpack.config.vendor.js": iSet["webpack"],
"webpack.config.vendor.ts": iSet["webpack"],
"webpack.config.vendor.production.js": iSet["webpack"],
"webpack.config.vendor.production.ts": iSet["webpack"],
"webpack.test.js": iSet["webpack"],
"webpack.test.ts": iSet["webpack"],
"webpack.dist.js": iSet["webpack"],
"webpack.dist.ts": iSet["webpack"],
"webpackfile.js": iSet["webpack"],
"webpackfile.ts": iSet["webpack"],
"ionic.config.json": iSet["ionic"],
".io-config.json": iSet["ionic"],
"gulpfile.js": iSet["gulp"],
"gulpfile.mjs": iSet["gulp"],
"gulpfile.ts": iSet["gulp"],
"gulpfile.babel.js": iSet["gulp"],
"package.json": iSet["nodejs"],
"package-lock.json": iSet["nodejs"],
".nvmrc": iSet["nodejs"],
".esmrc": iSet["nodejs"],
".node-version": iSet["nodejs"],
".npmignore": iSet["npm"],
".npmrc": iSet["npm"],
".yarnrc": iSet["yarn"],
"yarn.lock": iSet["yarn"],
".yarnclean": iSet["yarn"],
".yarn-integrity": iSet["yarn"],
"yarn-error.log": iSet["yarn"],
".yarnrc.yml": iSet["yarn"],
".yarnrc.yaml": iSet["yarn"],
"androidmanifest.xml": iSet["android"],
".env.defaults": iSet["tune"],
".env.example": iSet["tune"],
".env.sample": iSet["tune"],
".env.schema": iSet["tune"],
".env.local": iSet["tune"],
".env.dev": iSet["tune"],
".env.development": iSet["tune"],
".env.qa": iSet["tune"],
".env.prod": iSet["tune"],
".env.production": iSet["tune"],
".env.staging": iSet["tune"],
".env.preview": iSet["tune"],
".env.test": iSet["tune"],
".env.testing": iSet["tune"],
".env.development.local": iSet["tune"],
".env.qa.local": iSet["tune"],
".env.production.local": iSet["tune"],
".env.staging.local": iSet["tune"],
".env.test.local": iSet["tune"],
".babelrc": iSet["babel"],
".babelrc.js": iSet["babel"],
".babelrc.json": iSet["babel"],
"babel.config.json": iSet["babel"],
"babel.config.js": iSet["babel"],
"contributing.md": iSet["contributing"],
"readme.md": iSet["readme"],
"readme.txt": iSet["readme"],
"readme": iSet["readme"],
"changelog": iSet["changelog"],
"changelog.md": iSet["changelog"],
"changelog.txt": iSet["changelog"],
"changes": iSet["changelog"],
"changes.md": iSet["changelog"],
"changes.txt": iSet["changelog"],
"credits": iSet["credits"],
"credits.txt": iSet["credits"],
"credits.md": iSet["credits"],
"authors": iSet["authors"],
"authors.md": iSet["authors"],
"authors.txt": iSet["authors"],
"favicon.ico": iSet["favicon"],
"karma.conf.js": iSet["karma"],
"karma.conf.ts": iSet["karma"],
"karma.conf.coffee": iSet["karma"],
"karma.config.js": iSet["karma"],
"karma.config.ts": iSet["karma"],
"karma-main.js": iSet["karma"],
"karma-main.ts": iSet["karma"],
".travis.yml": iSet["travis"],
".codecov.yml": iSet["codecov"],
"codecov.yml": iSet["codecov"],
"protractor.conf.js": iSet["protractor"],
"protractor.conf.ts": iSet["protractor"],
"protractor.conf.coffee": iSet["protractor"],
"protractor.config.js": iSet["protractor"],
"protractor.config.ts": iSet["protractor"],
"procfile": iSet["heroku"],
"procfile.windows": iSet["heroku"],
".bowerrc": iSet["bower"],
"bower.json": iSet["bower"],
".eslintrc.js": iSet["eslint"],
".eslintrc.cjs": iSet["eslint"],
".eslintrc.yaml": iSet["eslint"],
".eslintrc.yml": iSet["eslint"],
".eslintrc.json": iSet["eslint"],
".eslintrc": iSet["eslint"],
".eslintignore": iSet["eslint"],
".eslintcache": iSet["eslint"],
"code_of_conduct.md": iSet["conduct"],
"code_of_conduct.txt": iSet["conduct"],
"mocha.opts": iSet["mocha"],
".mocharc.yml": iSet["mocha"],
".mocharc.yaml": iSet["mocha"],
".mocharc.js": iSet["mocha"],
".mocharc.json": iSet["mocha"],
".mocharc.jsonc": iSet["mocha"],
"jenkinsfile": iSet["jenkins"],
"firebase.json": iSet["firebase"],
".firebaserc": iSet["firebase"],
"firestore.rules": iSet["firebase"],
"firestore.indexes.json": iSet["firebase"],
".stylelintrc": iSet["stylelint"],
"stylelint.config.js": iSet["stylelint"],
".stylelintrc.json": iSet["stylelint"],
".stylelintrc.yaml": iSet["stylelint"],
".stylelintrc.yml": iSet["stylelint"],
".stylelintrc.js": iSet["stylelint"],
".stylelintignore": iSet["stylelint"],
".codeclimate.yml": iSet["code-climate"],
".prettierrc": iSet["prettier"],
"prettier.config.js": iSet["prettier"],
".prettierrc.js": iSet["prettier"],
".prettierrc.json": iSet["prettier"],
".prettierrc.yaml": iSet["prettier"],
".prettierrc.yml": iSet["prettier"],
".prettierignore": iSet["prettier"],
"gruntfile.js": iSet["grunt"],
"gruntfile.ts": iSet["grunt"],
"gruntfile.coffee": iSet["grunt"],
"gruntfile.babel.js": iSet["grunt"],
"gruntfile.babel.ts": iSet["grunt"],
"gruntfile.babel.coffee": iSet["grunt"],
"jest.config.js": iSet["jest"],
"jest.config.ts": iSet["jest"],
"jest.config.cjs": iSet["jest"],
"jest.config.mjs": iSet["jest"],
"jest.config.json": iSet["jest"],
"jest.e2e.config.js": iSet["jest"],
"jest.e2e.config.ts": iSet["jest"],
"jest.e2e.config.cjs": iSet["jest"],
"jest.e2e.config.mjs": iSet["jest"],
"jest.e2e.config.json": iSet["jest"],
"jest.setup.js": iSet["jest"],
"jest.setup.ts": iSet["jest"],
"jest.json": iSet["jest"],
".jestrc": iSet["jest"],
".jestrc.js": iSet["jest"],
".jestrc.json": iSet["jest"],
"jest.teardown.js": iSet["jest"],
"fastfile": iSet["fastlane"],
"appfile": iSet["fastlane"],
".helmignore": iSet["helm"],
"makefile": iSet["makefile"],
".releaserc": iSet["semantic-release"],
".releaserc.yaml": iSet["semantic-release"],
".releaserc.yml": iSet["semantic-release"],
".releaserc.json": iSet["semantic-release"],
".releaserc.js": iSet["semantic-release"],
"release.config.js": iSet["semantic-release"],
"bitbucket-pipelines.yaml": iSet["bitbucket"],
"bitbucket-pipelines.yml": iSet["bitbucket"],
"azure-pipelines.yml": iSet["azure-pipelines"],
"azure-pipelines.yaml": iSet["azure-pipelines"],
"vagrantfile": iSet["vagrant"],
"tailwind.js": iSet["tailwindcss"],
"tailwind.config.js": iSet["tailwindcss"],
"codeowners": iSet["codeowners"],
".gcloudignore": iSet["gcp"],
".huskyrc": iSet["husky"],
"husky.config.js": iSet["husky"],
".huskyrc.json": iSet["husky"],
".huskyrc.js": iSet["husky"],
".huskyrc.yaml": iSet["husky"],
".huskyrc.yml": iSet["husky"],
".commitlintrc": iSet["commitlint"],
".commitlintrc.js": iSet["commitlint"],
"commitlint.config.js": iSet["commitlint"],
".commitlintrc.json": iSet["commitlint"],
".commitlint.yaml": iSet["commitlint"],
".commitlint.yml": iSet["commitlint"],
"dune": iSet["dune"],
"dune-project": iSet["dune"],
"roadmap.md": iSet["roadmap"],
"roadmap.txt": iSet["roadmap"],
"timeline.md": iSet["roadmap"],
"timeline.txt": iSet["roadmap"],
"milestones.md": iSet["roadmap"],
"milestones.txt": iSet["roadmap"],
"nuget.config": iSet["nuget"],
".nuspec": iSet["nuget"],
"nuget.exe": iSet["nuget"],
"stryker.conf.js": iSet["stryker"],
"stryker.conf.json": iSet["stryker"],
".modernizrrc": iSet["modernizr"],
".modernizrrc.js": iSet["modernizr"],
".modernizrrc.json": iSet["modernizr"],
// ".vfl": iSet["vfl"],
// ".kl": iSet["kl"],
// "project.graphcool": iSet["graphcool"],
// ".flowconfig": iSet["flow"],
// ".bithoundrc": iSet["bithound"],
// ".appveyor.yml": iSet["appveyor"],
// "appveyor.yml": iSet["appveyor"],
// "fuse.js": iSet["fusebox"],
// ".editorconfig": iSet["editorconfig"],
// ".watchmanconfig": iSet["watchman"],
// "aurelia.json": iSet["aurelia"],
// "rollup.config.js": iSet["rollup"],
// "rollup.config.ts": iSet["rollup"],
// "rollup-config.js": iSet["rollup"],
// "rollup-config.ts": iSet["rollup"],
// "rollup.config.common.js": iSet["rollup"],
// "rollup.config.common.ts": iSet["rollup"],
// "rollup.config.base.js": iSet["rollup"],
// "rollup.config.base.ts": iSet["rollup"],
// "rollup.config.prod.js": iSet["rollup"],
// "rollup.config.prod.ts": iSet["rollup"],
// "rollup.config.dev.js": iSet["rollup"],
// "rollup.config.dev.ts": iSet["rollup"],
// "rollup.config.prod.vendor.js": iSet["rollup"],
// "rollup.config.prod.vendor.ts": iSet["rollup"],
// ".hhconfig": iSet["hack"],
// "apollo.config.js": iSet["apollo"],
// "nodemon.json": iSet["nodemon"],
// "nodemon-debug.json": iSet["nodemon"],
// ".hintrc": iSet["webhint"],
// "browserslist": iSet["browserlist"],
// ".browserslistrc": iSet["browserlist"],
// ".snyk": iSet["snyk"],
// ".drone.yml": iSet["drone"],
// ".sequelizerc": iSet["sequelize"],
// "gatsby.config.js": iSet["gatsby"],
// "gatsby-config.js": iSet["gatsby"],
// "gatsby-node.js": iSet["gatsby"],
// "gatsby-browser.js": iSet["gatsby"],
// "gatsby-ssr.js": iSet["gatsby"],
// ".wakatime-project": iSet["wakatime"],
// "circle.yml": iSet["circleci"],
// ".cfignore": iSet["cloudfoundry"],
// "wallaby.js": iSet["wallaby"],
// "wallaby.conf.js": iSet["wallaby"],
// "stencil.config.js": iSet["stencil"],
// "stencil.config.ts": iSet["stencil"],
// ".bazelignore": iSet["bazel"],
// ".bazelrc": iSet["bazel"],
// "prisma.yml": iSet["prisma"],
// ".nycrc": iSet["istanbul"],
// ".nycrc.json": iSet["istanbul"],
// "buildkite.yml": iSet["buildkite"],
// "buildkite.yaml": iSet["buildkite"],
// "netlify.json": iSet["netlify"],
// "netlify.yml": iSet["netlify"],
// "netlify.yaml": iSet["netlify"],
// "netlify.toml": iSet["netlify"],
// "nest-cli.json": iSet["nest"],
// ".nest-cli.json": iSet["nest"],
// "nestconfig.json": iSet["nest"],
// ".nestconfig.json": iSet["nest"],
// ".percy.yml": iSet["percy"],
// ".gitpod.yml": iSet["gitpod"],
// "tiltfile": iSet["tilt"],
// "capacitor.config.json": iSet["capacitor"],
// ".adonisrc.json": iSet["adonis"],
// "ace": iSet["adonis"],
// "meson.build": iSet["meson"],
// ".buckconfig": iSet["buck"],
// "nx.json": iSet["nrwl"],
// ".slugignore": iSet["slug"],
}
+342
View File
@@ -0,0 +1,342 @@
package main
import "fmt"
// iInfo (icon information)
type iInfo struct {
i string
c [3]uint8 // represents the color in rgb (default 0,0,0 is black)
}
func (i *iInfo) getGlyph() string {
return i.i
}
func (i *iInfo) getColor(f uint8) string {
if f == 1 {
return fmt.Sprintf("\033[38;2;%03d;%03d;%03dm", i.c[0], i.c[1], i.c[2])
}
return fmt.Sprintf("\033[38;2;%03d;%03d;%03dm", i.c[0], i.c[1], i.c[2])
}
var iSet = map[string]*iInfo{
"html": {"\uf13b", [3]uint8{228, 79, 57}}, // html
"markdown": {"\uf853", [3]uint8{66, 165, 245}}, // markdown
"css": {"\uf81b", [3]uint8{66, 165, 245}}, // css
"sass": {"\ue603", [3]uint8{237, 80, 122}}, // sass
"less": {"\ue60b", [3]uint8{2, 119, 189}}, // less
"json": {"\ue60b", [3]uint8{251, 193, 60}}, // json
"yaml": {"\ue60b", [3]uint8{244, 68, 62}}, // yaml
"xml": {"\uf72d", [3]uint8{64, 153, 69}}, // xml
"image": {"\uf71e", [3]uint8{48, 166, 154}}, // image
"javascript": {"\ue74e", [3]uint8{255, 202, 61}}, // javascript
"react": {"\ue7ba", [3]uint8{35, 188, 212}}, // react
"react_ts": {"\ue7ba", [3]uint8{36, 142, 211}}, // react_ts
"settings": {"\uf013", [3]uint8{66, 165, 245}}, // settings
"typescript": {"\ue628", [3]uint8{3, 136, 209}}, // typescript
"pdf": {"\uf724", [3]uint8{244, 68, 62}}, // pdf
"table": {"\uf71a", [3]uint8{139, 195, 74}}, // table
"visualstudio": {"\ue70c", [3]uint8{173, 99, 188}}, // visualstudio
"database": {"\ue706", [3]uint8{255, 202, 61}}, // database
"mysql": {"\ue704", [3]uint8{1, 94, 134}}, // mysql
"postgresql": {"\ue76e", [3]uint8{49, 99, 140}}, // postgresql
"sqlite": {"\ue7c4", [3]uint8{1, 57, 84}}, // sqlite
"csharp": {"\uf81a", [3]uint8{2, 119, 189}}, // csharp
"zip": {"\uf410", [3]uint8{175, 180, 43}}, // zip
"exe": {"\uf2d0", [3]uint8{229, 77, 58}}, // exe
"java": {"\uf675", [3]uint8{244, 68, 62}}, // java
"c": {"\ufb70", [3]uint8{2, 119, 189}}, // c
"cpp": {"\ufb71", [3]uint8{2, 119, 189}}, // cpp
"go": {"\ufcd1", [3]uint8{32, 173, 194}}, // go
"go-mod": {"\ufcd1", [3]uint8{237, 80, 122}}, // go-mod
"python": {"\uf81f", [3]uint8{52, 102, 143}}, // python
"python-misc": {"\uf820", [3]uint8{130, 61, 28}}, // python-misc
"url": {"\uf836", [3]uint8{66, 165, 245}}, // url
"console": {"\uf68c", [3]uint8{250, 111, 66}}, // console
"word": {"\uf72b", [3]uint8{1, 87, 155}}, // word
"certificate": {"\uf623", [3]uint8{249, 89, 63}}, // certificate
"key": {"\uf805", [3]uint8{48, 166, 154}}, // key
"font": {"\uf031", [3]uint8{244, 68, 62}}, // font
"lib": {"\uf831", [3]uint8{139, 195, 74}}, // lib
"ruby": {"\ue739", [3]uint8{229, 61, 58}}, // ruby
"gemfile": {"\ue21e", [3]uint8{229, 61, 58}}, // gemfile
"fsharp": {"\ue7a7", [3]uint8{55, 139, 186}}, // fsharp
"swift": {"\ufbe3", [3]uint8{249, 95, 63}}, // swift
"docker": {"\uf308", [3]uint8{1, 135, 201}}, // docker
"powerpoint": {"\uf726", [3]uint8{209, 71, 51}}, // powerpoint
"video": {"\uf72a", [3]uint8{253, 154, 62}}, // video
"virtual": {"\uf822", [3]uint8{3, 155, 229}}, // virtual
"email": {"\uf6ed", [3]uint8{66, 165, 245}}, // email
"audio": {"\ufb75", [3]uint8{239, 83, 80}}, // audio
"coffee": {"\uf675", [3]uint8{66, 165, 245}}, // coffee
"document": {"\uf718", [3]uint8{66, 165, 245}}, // document
"rust": {"\ue7a8", [3]uint8{250, 111, 66}}, // rust
"raml": {"\ue60b", [3]uint8{66, 165, 245}}, // raml
"xaml": {"\ufb72", [3]uint8{66, 165, 245}}, // xaml
"haskell": {"\ue61f", [3]uint8{254, 168, 62}}, // haskell
"git": {"\ue702", [3]uint8{229, 77, 58}}, // git
"lua": {"\ue620", [3]uint8{66, 165, 245}}, // lua
"clojure": {"\ue76a", [3]uint8{100, 221, 23}}, // clojure
"groovy": {"\uf2a6", [3]uint8{41, 198, 218}}, // groovy
"r": {"\ufcd2", [3]uint8{25, 118, 210}}, // r
"dart": {"\ue798", [3]uint8{87, 182, 240}}, // dart
"mxml": {"\uf72d", [3]uint8{254, 168, 62}}, // mxml
"assembly": {"\uf471", [3]uint8{250, 109, 63}}, // assembly
"vue": {"\ufd42", [3]uint8{65, 184, 131}}, // vue
"vue-config": {"\ufd42", [3]uint8{58, 121, 110}}, // vue-config
"lock": {"\uf83d", [3]uint8{255, 213, 79}}, // lock
"handlebars": {"\ue60f", [3]uint8{250, 111, 66}}, // handlebars
"perl": {"\ue769", [3]uint8{149, 117, 205}}, // perl
"elixir": {"\ue62d", [3]uint8{149, 117, 205}}, // elixir
"erlang": {"\ue7b1", [3]uint8{244, 68, 62}}, // erlang
"twig": {"\ue61c", [3]uint8{155, 185, 47}}, // twig
"julia": {"\ue624", [3]uint8{134, 82, 159}}, // julia
"elm": {"\ue62c", [3]uint8{96, 181, 204}}, // elm
"smarty": {"\uf834", [3]uint8{255, 207, 60}}, // smarty
"stylus": {"\ue600", [3]uint8{192, 202, 51}}, // stylus
"verilog": {"\ufb19", [3]uint8{250, 111, 66}}, // verilog
"robot": {"\ufba7", [3]uint8{249, 89, 63}}, // robot
"solidity": {"\ufcb9", [3]uint8{3, 136, 209}}, // solidity
"yang": {"\ufb7e", [3]uint8{66, 165, 245}}, // yang
"vercel": {"\uf47e", [3]uint8{207, 216, 220}}, // vercel
"applescript": {"\uf302", [3]uint8{120, 144, 156}}, // applescript
"cake": {"\uf5ea", [3]uint8{250, 111, 66}}, // cake
"nim": {"\uf6a4", [3]uint8{255, 202, 61}}, // nim
"todo": {"\uf058", [3]uint8{124, 179, 66}}, // todo
"nix": {"\uf313", [3]uint8{80, 117, 193}}, // nix
"http": {"\uf484", [3]uint8{66, 165, 245}}, // http
"webpack": {"\ufc29", [3]uint8{142, 214, 251}}, // webpack
"ionic": {"\ue7a9", [3]uint8{79, 143, 247}}, // ionic
"gulp": {"\ue763", [3]uint8{229, 61, 58}}, // gulp
"nodejs": {"\uf898", [3]uint8{139, 195, 74}}, // nodejs
"npm": {"\ue71e", [3]uint8{203, 56, 55}}, // npm
"yarn": {"\uf61a", [3]uint8{44, 142, 187}}, // yarn
"android": {"\uf531", [3]uint8{139, 195, 74}}, // android
"tune": {"\ufb69", [3]uint8{251, 193, 60}}, // tune
"contributing": {"\uf64d", [3]uint8{255, 202, 61}}, // contributing
"readme": {"\uf7fb", [3]uint8{66, 165, 245}}, // readme
"changelog": {"\ufba6", [3]uint8{139, 195, 74}}, // changelog
"credits": {"\uf75f", [3]uint8{156, 204, 101}}, // credits
"authors": {"\uf0c0", [3]uint8{244, 68, 62}}, // authors
"favicon": {"\ue623", [3]uint8{255, 213, 79}}, // favicon
"karma": {"\ue622", [3]uint8{60, 190, 174}}, // karma
"travis": {"\ue77e", [3]uint8{203, 58, 73}}, // travis
"heroku": {"\ue607", [3]uint8{105, 99, 185}}, // heroku
"gitlab": {"\uf296", [3]uint8{226, 69, 57}}, // gitlab
"bower": {"\ue61a", [3]uint8{239, 88, 60}}, // bower
"conduct": {"\uf64b", [3]uint8{205, 220, 57}}, // conduct
"jenkins": {"\ue767", [3]uint8{240, 214, 183}}, // jenkins
"code-climate": {"\uf7f4", [3]uint8{238, 238, 238}}, // code-climate
"log": {"\uf719", [3]uint8{175, 180, 43}}, // log
"ejs": {"\ue618", [3]uint8{255, 202, 61}}, // ejs
"grunt": {"\ue611", [3]uint8{251, 170, 61}}, // grunt
"django": {"\ue71d", [3]uint8{67, 160, 71}}, // django
"makefile": {"\uf728", [3]uint8{239, 83, 80}}, // makefile
"bitbucket": {"\uf171", [3]uint8{31, 136, 229}}, // bitbucket
"d": {"\ue7af", [3]uint8{244, 68, 62}}, // d
"mdx": {"\uf853", [3]uint8{255, 202, 61}}, // mdx
"azure-pipelines": {"\uf427", [3]uint8{20, 101, 192}}, // azure-pipelines
"azure": {"\ufd03", [3]uint8{31, 136, 229}}, // azure
"razor": {"\uf564", [3]uint8{66, 165, 245}}, // razor
"asciidoc": {"\uf718", [3]uint8{244, 68, 62}}, // asciidoc
"edge": {"\uf564", [3]uint8{239, 111, 60}}, // edge
"scheme": {"\ufb26", [3]uint8{244, 68, 62}}, // scheme
"3d": {"\ue79b", [3]uint8{40, 182, 246}}, // 3d
"svg": {"\ufc1f", [3]uint8{255, 181, 62}}, // svg
"vim": {"\ue62b", [3]uint8{67, 160, 71}}, // vim
"moonscript": {"\uf186", [3]uint8{251, 193, 60}}, // moonscript
"codeowners": {"\uf507", [3]uint8{175, 180, 43}}, // codeowners
"disc": {"\ue271", [3]uint8{176, 190, 197}}, // disc
"fortran": {"F", [3]uint8{250, 111, 66}}, // fortran
"tcl": {"\ufbd1", [3]uint8{239, 83, 80}}, // tcl
"liquid": {"\ue275", [3]uint8{40, 182, 246}}, // liquid
"prolog": {"\ue7a1", [3]uint8{239, 83, 80}}, // prolog
"husky": {"\uf8e8", [3]uint8{229, 229, 229}}, // husky
"coconut": {"\uf5d2", [3]uint8{141, 110, 99}}, // coconut
"sketch": {"\uf6c7", [3]uint8{255, 194, 61}}, // sketch
"pawn": {"\ue261", [3]uint8{239, 111, 60}}, // pawn
"commitlint": {"\ufc16", [3]uint8{43, 150, 137}}, // commitlint
"dhall": {"\uf448", [3]uint8{120, 144, 156}}, // dhall
"dune": {"\uf7f4", [3]uint8{244, 127, 61}}, // dune
"shaderlab": {"\ufbad", [3]uint8{25, 118, 210}}, // shaderlab
"command": {"\ufb32", [3]uint8{175, 188, 194}}, // command
"stryker": {"\uf05b", [3]uint8{239, 83, 80}}, // stryker
"modernizr": {"\ue720", [3]uint8{234, 72, 99}}, // modernizr
"roadmap": {"\ufb6d", [3]uint8{48, 166, 154}}, // roadmap
"debian": {"\uf306", [3]uint8{211, 61, 76}}, // debian
"ubuntu": {"\uf31c", [3]uint8{214, 73, 53}}, // ubuntu
"arch": {"\uf303", [3]uint8{33, 142, 202}}, // arch
"redhat": {"\uf316", [3]uint8{231, 61, 58}}, // redhat
"gentoo": {"\uf30d", [3]uint8{148, 141, 211}}, // gentoo
"linux": {"\ue712", [3]uint8{238, 207, 55}}, // linux
"raspberry-pi": {"\uf315", [3]uint8{208, 60, 76}}, // raspberry-pi
"manjaro": {"\uf312", [3]uint8{73, 185, 90}}, // manjaro
"opensuse": {"\uf314", [3]uint8{111, 180, 36}}, // opensuse
"fedora": {"\uf30a", [3]uint8{52, 103, 172}}, // fedora
"freebsd": {"\uf30c", [3]uint8{175, 44, 42}}, // freebsd
"centOS": {"\uf304", [3]uint8{157, 83, 135}}, // centOS
"alpine": {"\uf300", [3]uint8{14, 87, 123}}, // alpine
"mint": {"\uf30f", [3]uint8{125, 190, 58}}, // mint
"pug": {"\ue60e", [3]uint8{239, 204, 163}}, // pug (Not supported by nerdFont)
"blink": {"\uf72a", [3]uint8{249, 169, 60}}, // blink (The Foundry Nuke) (Not supported by nerdFont)
"postcss": {"\uf81b", [3]uint8{244, 68, 62}}, // postcss (Not supported by nerdFont)
"jinja": {"\ue000", [3]uint8{174, 44, 42}}, // jinja (Not supported by nerdFont)
"sublime": {"\ue7aa", [3]uint8{239, 148, 58}}, // sublime (Not supported by nerdFont)
"markojs": {"\uf13b", [3]uint8{2, 119, 189}}, // markojs (Not supported by nerdFont)
"vscode": {"\ue70c", [3]uint8{33, 150, 243}}, // vscode (Not supported by nerdFont)
"qsharp": {"\uf292", [3]uint8{251, 193, 60}}, // qsharp (Not supported by nerdFont)
"vala": {"\uf7ab", [3]uint8{149, 117, 205}}, // vala (Not supported by nerdFont)
"zig": {"Z", [3]uint8{249, 169, 60}}, // zig (Not supported by nerdFont)
"h": {"h", [3]uint8{2, 119, 189}}, // h (Not supported by nerdFont)
"hpp": {"h", [3]uint8{2, 119, 189}}, // hpp (Not supported by nerdFont)
"powershell": {"\ufcb5", [3]uint8{5, 169, 244}}, // powershell (Not supported by nerdFont)
"gradle": {"\ufcc4", [3]uint8{29, 151, 167}}, // gradle (Not supported by nerdFont)
"arduino": {"\ue255", [3]uint8{35, 151, 156}}, // arduino (Not supported by nerdFont)
"tex": {"\uf783", [3]uint8{66, 165, 245}}, // tex (Not supported by nerdFont)
"graphql": {"\ue284", [3]uint8{237, 80, 122}}, // graphql (Not supported by nerdFont)
"kotlin": {"\ue70e", [3]uint8{139, 195, 74}}, // kotlin (Not supported by nerdFont)
"actionscript": {"\ufb25", [3]uint8{244, 68, 62}}, // actionscript (Not supported by nerdFont)
"autohotkey": {"\uf812", [3]uint8{76, 175, 80}}, // autohotkey (Not supported by nerdFont)
"flash": {"\uf740", [3]uint8{198, 52, 54}}, // flash (Not supported by nerdFont)
"swc": {"\ufbd3", [3]uint8{198, 52, 54}}, // swc (Not supported by nerdFont)
"cmake": {"\uf425", [3]uint8{178, 178, 179}}, // cmake (Not supported by nerdFont)
"nuxt": {"\ue2a6", [3]uint8{65, 184, 131}}, // nuxt (Not supported by nerdFont)
"ocaml": {"\uf1ce", [3]uint8{253, 154, 62}}, // ocaml (Not supported by nerdFont)
"haxe": {"\uf425", [3]uint8{246, 137, 61}}, // haxe (Not supported by nerdFont)
"puppet": {"\uf595", [3]uint8{251, 193, 60}}, // puppet (Not supported by nerdFont)
"purescript": {"\uf670", [3]uint8{66, 165, 245}}, // purescript (Not supported by nerdFont)
"merlin": {"\uf136", [3]uint8{66, 165, 245}}, // merlin (Not supported by nerdFont)
"mjml": {"\ue714", [3]uint8{249, 89, 63}}, // mjml (Not supported by nerdFont)
"terraform": {"\ue20f", [3]uint8{92, 107, 192}}, // terraform (Not supported by nerdFont)
"apiblueprint": {"\uf031", [3]uint8{66, 165, 245}}, // apiblueprint (Not supported by nerdFont)
"slim": {"\uf24e", [3]uint8{245, 129, 61}}, // slim (Not supported by nerdFont)
"babel": {"\uf5a0", [3]uint8{253, 217, 59}}, // babel (Not supported by nerdFont)
"codecov": {"\ue37c", [3]uint8{237, 80, 122}}, // codecov (Not supported by nerdFont)
"protractor": {"\uf288", [3]uint8{229, 61, 58}}, // protractor (Not supported by nerdFont)
"eslint": {"\ufbf6", [3]uint8{121, 134, 203}}, // eslint (Not supported by nerdFont)
"mocha": {"\uf6a9", [3]uint8{161, 136, 127}}, // mocha (Not supported by nerdFont)
"firebase": {"\ue787", [3]uint8{251, 193, 60}}, // firebase (Not supported by nerdFont)
"stylelint": {"\ufb76", [3]uint8{207, 216, 220}}, // stylelint (Not supported by nerdFont)
"prettier": {"\uf8e2", [3]uint8{86, 179, 180}}, // prettier (Not supported by nerdFont)
"jest": {"J", [3]uint8{244, 85, 62}}, // jest (Not supported by nerdFont)
"storybook": {"\ufd2c", [3]uint8{237, 80, 122}}, // storybook (Not supported by nerdFont)
"fastlane": {"\ufbff", [3]uint8{149, 119, 232}}, // fastlane (Not supported by nerdFont)
"helm": {"\ufd31", [3]uint8{32, 173, 194}}, // helm (Not supported by nerdFont)
"i18n": {"\uf7be", [3]uint8{121, 134, 203}}, // i18n (Not supported by nerdFont)
"semantic-release": {"\uf70f", [3]uint8{245, 245, 245}}, // semantic-release (Not supported by nerdFont)
"godot": {"\ufba7", [3]uint8{79, 195, 247}}, // godot (Not supported by nerdFont)
"godot-assets": {"\ufba7", [3]uint8{129, 199, 132}}, // godot-assets (Not supported by nerdFont)
"vagrant": {"\uf27d", [3]uint8{20, 101, 192}}, // vagrant (Not supported by nerdFont)
"tailwindcss": {"\ufc8b", [3]uint8{77, 182, 172}}, // tailwindcss (Not supported by nerdFont)
"gcp": {"\uf662", [3]uint8{70, 136, 250}}, // gcp (Not supported by nerdFont)
"opam": {"\uf1ce", [3]uint8{255, 213, 79}}, // opam (Not supported by nerdFont)
"pascal": {"\uf8da", [3]uint8{3, 136, 209}}, // pascal (Not supported by nerdFont)
"nuget": {"\ue77f", [3]uint8{3, 136, 209}}, // nuget (Not supported by nerdFont)
"denizenscript": {"D", [3]uint8{255, 213, 79}}, // denizenscript (Not supported by nerdFont)
// "riot": {"\u", [3]uint8{255, 255, 255}}, // riot
// "autoit": {"\u", [3]uint8{255, 255, 255}}, // autoit
// "livescript": {"\u", [3]uint8{255, 255, 255}}, // livescript
// "reason": {"\u", [3]uint8{255, 255, 255}}, // reason
// "bucklescript": {"\u", [3]uint8{255, 255, 255}}, // bucklescript
// "mathematica": {"\u", [3]uint8{255, 255, 255}}, // mathematica
// "wolframlanguage": {"\u", [3]uint8{255, 255, 255}}, // wolframlanguage
// "nunjucks": {"\u", [3]uint8{255, 255, 255}}, // nunjucks
// "haml": {"\u", [3]uint8{255, 255, 255}}, // haml
// "cucumber": {"\u", [3]uint8{255, 255, 255}}, // cucumber
// "vfl": {"\u", [3]uint8{255, 255, 255}}, // vfl
// "kl": {"\u", [3]uint8{255, 255, 255}}, // kl
// "coldfusion": {"\u", [3]uint8{255, 255, 255}}, // coldfusion
// "cabal": {"\u", [3]uint8{255, 255, 255}}, // cabal
// "restql": {"\u", [3]uint8{255, 255, 255}}, // restql
// "kivy": {"\u", [3]uint8{255, 255, 255}}, // kivy
// "graphcool": {"\u", [3]uint8{255, 255, 255}}, // graphcool
// "sbt": {"\u", [3]uint8{255, 255, 255}}, // sbt
// "flow": {"\u", [3]uint8{255, 255, 255}}, // flow
// "bithound": {"\u", [3]uint8{255, 255, 255}}, // bithound
// "appveyor": {"\u", [3]uint8{255, 255, 255}}, // appveyor
// "fusebox": {"\u", [3]uint8{255, 255, 255}}, // fusebox
// "editorconfig": {"\u", [3]uint8{255, 255, 255}}, // editorconfig
// "watchman": {"\u", [3]uint8{255, 255, 255}}, // watchman
// "aurelia": {"\u", [3]uint8{255, 255, 255}}, // aurelia
// "rollup": {"\u", [3]uint8{255, 255, 255}}, // rollup
// "hack": {"\u", [3]uint8{255, 255, 255}}, // hack
// "apollo": {"\u", [3]uint8{255, 255, 255}}, // apollo
// "nodemon": {"\u", [3]uint8{255, 255, 255}}, // nodemon
// "webhint": {"\u", [3]uint8{255, 255, 255}}, // webhint
// "browserlist": {"\u", [3]uint8{255, 255, 255}}, // browserlist
// "crystal": {"\u", [3]uint8{255, 255, 255}}, // crystal
// "snyk": {"\u", [3]uint8{255, 255, 255}}, // snyk
// "drone": {"\u", [3]uint8{255, 255, 255}}, // drone
// "cuda": {"\u", [3]uint8{255, 255, 255}}, // cuda
// "dotjs": {"\u", [3]uint8{255, 255, 255}}, // dotjs
// "sequelize": {"\u", [3]uint8{255, 255, 255}}, // sequelize
// "gatsby": {"\u", [3]uint8{255, 255, 255}}, // gatsby
// "wakatime": {"\u", [3]uint8{255, 255, 255}}, // wakatime
// "circleci": {"\u", [3]uint8{255, 255, 255}}, // circleci
// "cloudfoundry": {"\u", [3]uint8{255, 255, 255}}, // cloudfoundry
// "processing": {"\u", [3]uint8{255, 255, 255}}, // processing
// "wepy": {"\u", [3]uint8{255, 255, 255}}, // wepy
// "hcl": {"\u", [3]uint8{255, 255, 255}}, // hcl
// "san": {"\u", [3]uint8{255, 255, 255}}, // san
// "wallaby": {"\u", [3]uint8{255, 255, 255}}, // wallaby
// "stencil": {"\u", [3]uint8{255, 255, 255}}, // stencil
// "red": {"\u", [3]uint8{255, 255, 255}}, // red
// "webassembly": {"\u", [3]uint8{255, 255, 255}}, // webassembly
// "foxpro": {"\u", [3]uint8{255, 255, 255}}, // foxpro
// "jupyter": {"\u", [3]uint8{255, 255, 255}}, // jupyter
// "ballerina": {"\u", [3]uint8{255, 255, 255}}, // ballerina
// "racket": {"\u", [3]uint8{255, 255, 255}}, // racket
// "bazel": {"\u", [3]uint8{255, 255, 255}}, // bazel
// "mint": {"\u", [3]uint8{255, 255, 255}}, // mint
// "velocity": {"\u", [3]uint8{255, 255, 255}}, // velocity
// "prisma": {"\u", [3]uint8{255, 255, 255}}, // prisma
// "abc": {"\u", [3]uint8{255, 255, 255}}, // abc
// "istanbul": {"\u", [3]uint8{255, 255, 255}}, // istanbul
// "lisp": {"\u", [3]uint8{255, 255, 255}}, // lisp
// "buildkite": {"\u", [3]uint8{255, 255, 255}}, // buildkite
// "netlify": {"\u", [3]uint8{255, 255, 255}}, // netlify
// "svelte": {"\u", [3]uint8{255, 255, 255}}, // svelte
// "nest": {"\u", [3]uint8{255, 255, 255}}, // nest
// "percy": {"\u", [3]uint8{255, 255, 255}}, // percy
// "gitpod": {"\u", [3]uint8{255, 255, 255}}, // gitpod
// "advpl_prw": {"\u", [3]uint8{255, 255, 255}}, // advpl_prw
// "advpl_ptm": {"\u", [3]uint8{255, 255, 255}}, // advpl_ptm
// "advpl_tlpp": {"\u", [3]uint8{255, 255, 255}}, // advpl_tlpp
// "advpl_include": {"\u", [3]uint8{255, 255, 255}}, // advpl_include
// "tilt": {"\u", [3]uint8{255, 255, 255}}, // tilt
// "capacitor": {"\u", [3]uint8{255, 255, 255}}, // capacitor
// "adonis": {"\u", [3]uint8{255, 255, 255}}, // adonis
// "forth": {"\u", [3]uint8{255, 255, 255}}, // forth
// "uml": {"\u", [3]uint8{255, 255, 255}}, // uml
// "meson": {"\u", [3]uint8{255, 255, 255}}, // meson
// "buck": {"\u", [3]uint8{255, 255, 255}}, // buck
// "sml": {"\u", [3]uint8{255, 255, 255}}, // sml
// "nrwl": {"\u", [3]uint8{255, 255, 255}}, // nrwl
// "imba": {"\u", [3]uint8{255, 255, 255}}, // imba
// "drawio": {"\u", [3]uint8{255, 255, 255}}, // drawio
// "sas": {"\u", [3]uint8{255, 255, 255}}, // sas
// "slug": {"\u", [3]uint8{255, 255, 255}}, // slug
"dir-config": {"\ue5fc", [3]uint8{32, 173, 194}}, // dir-config
"dir-controller": {"\ue5fc", [3]uint8{255, 194, 61}}, // dir-controller
"dir-git": {"\ue5fb", [3]uint8{250, 111, 66}}, // dir-git
"dir-github": {"\ue5fd", [3]uint8{84, 110, 122}}, // dir-github
"dir-npm": {"\ue5fa", [3]uint8{203, 56, 55}}, // dir-npm
"dir-include": {"\uf756", [3]uint8{3, 155, 229}}, // dir-include
"dir-import": {"\uf756", [3]uint8{175, 180, 43}}, // dir-import
"dir-upload": {"\uf758", [3]uint8{250, 111, 66}}, // dir-upload
"dir-download": {"\uf74c", [3]uint8{76, 175, 80}}, // dir-download
"dir-secure": {"\uf74f", [3]uint8{249, 169, 60}}, // dir-secure
"dir-images": {"\uf74e", [3]uint8{43, 150, 137}}, // dir-images
"dir-environment": {"\uf74e", [3]uint8{102, 187, 106}}, // dir-environment
}
// default icons in case nothing can be found
var iDef = map[string]*iInfo{
"dir": {"\uf74a", [3]uint8{224, 177, 77}},
"diropen": {"\ufc6e", [3]uint8{224, 177, 77}},
"hiddendir": {"\uf755", [3]uint8{224, 177, 77}},
"exe": {"\uf713", [3]uint8{76, 175, 80}},
"file": {"\uf723", [3]uint8{65, 129, 190}},
"hiddenfile": {"\ufb12", [3]uint8{65, 129, 190}},
}
+94
View File
@@ -0,0 +1,94 @@
package main
import (
"bytes"
"fmt"
"io"
"log"
"os"
"sort"
"testing"
"github.com/Yash-Handa/logo-ls/ctw"
"golang.org/x/crypto/ssh/terminal"
)
func TestFileIcons(t *testing.T) {
log.Println("Printing each supported file name and ext by the icon pack")
// get terminal width
var e error = nil
terminalWidth, _, e = terminal.GetSize(int(os.Stdout.Fd()))
if e != nil {
terminalWidth = 80
}
ks := make([]string, 0)
for k := range iSet {
ks = append(ks, k)
}
sort.Strings(ks)
for _, v := range ks {
t.Run("Testing icon: "+v, func(st *testing.T) {
i := iSet[v]
fmt.Fprintln(os.Stderr)
buf := bytes.NewBuffer([]byte(""))
log.Println("Printing files of type", i.getColor(1)+v+"\033[38;2;255;255;255m")
w := ctw.New(terminalWidth)
for f, d := range Icon_FileName {
if d == i {
w.AddRow(" ", d.getGlyph(), f, "")
w.IconColor(d.getColor(1))
}
}
w.Flush(buf)
io.Copy(os.Stderr, buf)
buf = bytes.NewBuffer([]byte(""))
log.Println("Printing extentions of type", i.getColor(1)+v+"\033[38;2;255;255;255m")
w = ctw.New(terminalWidth)
for e, d := range Icon_Ext {
if d == i {
w.AddRow(" ", d.getGlyph(), e, "")
w.IconColor(d.getColor(1))
}
}
w.Flush(buf)
io.Copy(os.Stderr, buf)
})
}
}
func TestIconDisplay(t *testing.T) {
// get terminal width
var e error = nil
terminalWidth, _, e = terminal.GetSize(int(os.Stdout.Fd()))
if e != nil {
terminalWidth = 80
}
temp := [2]map[string]*iInfo{iSet, iDef}
for i, set := range temp {
t.Run(fmt.Sprintf("Icon Set %d", i+1), func(st *testing.T) {
//sorting alphabetically
ks := make([]string, 0)
for k := range set {
ks = append(ks, k)
}
sort.Strings(ks)
// display icons
buf := bytes.NewBuffer([]byte("\n"))
w := ctw.New(terminalWidth)
for _, v := range ks {
w.AddRow(" ", set[v].getGlyph(), v, "")
w.IconColor(set[v].getColor(1))
}
w.Flush(buf)
io.Copy(os.Stdout, buf)
fmt.Fprintln(os.Stdout)
})
}
}
BIN
View File
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
[ENVIRONMENT]
For correct display of icons the terminal should support UTF-8 encoding
with NERD FONT <https://github.com/ryanoasis/nerd-fonts> patched font.
For correct display of colors the terminal should support TRUE COLOR.
[REPORTING BUGS]
Report Bugs to <https://github.com/Yash-Handa/logo-ls/issues>
[SEE ALSO]
Full documentation with examples at: <https://www.github.com/Yash-Handa/logo-ls>
+60 -20
View File
@@ -8,6 +8,7 @@ import (
"sort"
"time"
"github.com/Yash-Handa/logo-ls/ctw"
"github.com/pborman/getopt/v2"
"golang.org/x/crypto/ssh/terminal"
)
@@ -19,6 +20,9 @@ const (
flag_l uint = 1 << iota
flag_a
flag_alpha // sort in alphabetic order (default)
flag_i // stop printing of icons
flag_c // stop printing of colors
flag_D // stop printing of git status
flag_A
flag_h
flag_R
@@ -65,11 +69,18 @@ func set_osExitCode(c int) int {
return osExitCode
}
var openDir = iDef["diropen"].getColor(1) + iDef["diropen"].getGlyph() + "\033[38;2;255;255;255m" + " "
func main() {
// content flags
f_a := getopt.BoolLong("all", 'a', "do not ignore entries starting with .")
f_A := getopt.BoolLong("almost-all", 'A', "do not list implied . and ..")
// disable Stuff
f_D := getopt.BoolLong("git-status", 'D', "print git status of files")
f_c := getopt.BoolLong("disable-color", 'c', "don't color icons, filenames and git status (use this to print to a file)")
f_i := getopt.BoolLong("disable-icon", 'i', "don't print icons of the files")
// display flags
f_1 := getopt.Bool('1', "list one file per line.")
f_d := getopt.BoolLong("directory", 'd', "list directories themselves, not their contents")
@@ -91,7 +102,7 @@ func main() {
f_R := getopt.BoolLong("recursive", 'R', "list subdirectories recursively")
f_T := getopt.EnumLong("time-style", 'T', []string{"Stamp", "StampMilli", "Kitchen", "ANSIC", "UnixDate", "RubyDate", "RFC1123", "RFC1123Z", "RFC3339", "RFC822", "RFC822Z", "RFC850"}, "Stamp", "time/date format with -l; see time-style below")
f_help := getopt.Bool('?', "display this help and exit")
f_help := getopt.BoolLong("help", '?', "display this help and exit")
f_V := getopt.BoolLong("version", 'V', "output version information and exit")
// using getopt.Getopt instead of parse to provide custom err
@@ -104,26 +115,35 @@ func main() {
// if f_help is provided print help and exit(0)
if *f_help {
fmt.Println("List information about the FILEs with ICONS and GIT STATUS (the current dir \nby default). Sort entries alphabetically if none of -tvSUX is specified.")
getopt.PrintUsage(os.Stdout)
fmt.Println("\nPossible value for --time-style (-T)")
fmt.Printf("%-11s %-32q\n", "ANSIC", "Mon Jan _2 15:04:05 2006")
fmt.Printf("%-11s %-32q\n", "UnixDate", "Mon Jan _2 15:04:05 MST 2006")
fmt.Printf("%-11s %-32q\n", "RubyDate", "Mon Jan 02 15:04:05 -0700 2006")
fmt.Printf("%-11s %-32q\n", "RFC822", "02 Jan 06 15:04 MST")
fmt.Printf("%-11s %-32q\n", "RFC822Z", "02 Jan 06 15:04 -0700")
fmt.Printf("%-11s %-32q\n", "RFC850", "Monday, 02-Jan-06 15:04:05 MST")
fmt.Printf("%-11s %-32q\n", "RFC1123", "Mon, 02 Jan 2006 15:04:05 MST")
fmt.Printf("%-11s %-32q\n", "RFC1123Z", "Mon, 02 Jan 2006 15:04:05 -0700")
fmt.Printf("%-11s %-32q\n", "RFC3339", "2006-01-02T15:04:05Z07:00")
fmt.Printf("%-11s %-32q\n", "Kitchen", "3:04PM")
fmt.Printf("%-11s %-32q [Default]\n", "Stamp", "Mon Jan _2 15:04:05")
fmt.Printf("%-11s %-32q\n", "StampMilli", "Jan _2 15:04:05.000")
fmt.Printf(" %-11s %-32q\n", "ANSIC", "Mon Jan _2 15:04:05 2006")
fmt.Printf(" %-11s %-32q\n", "UnixDate", "Mon Jan _2 15:04:05 MST 2006")
fmt.Printf(" %-11s %-32q\n", "RubyDate", "Mon Jan 02 15:04:05 -0700 2006")
fmt.Printf(" %-11s %-32q\n", "RFC822", "02 Jan 06 15:04 MST")
fmt.Printf(" %-11s %-32q\n", "RFC822Z", "02 Jan 06 15:04 -0700")
fmt.Printf(" %-11s %-32q\n", "RFC850", "Monday, 02-Jan-06 15:04:05 MST")
fmt.Printf(" %-11s %-32q\n", "RFC1123", "Mon, 02 Jan 2006 15:04:05 MST")
fmt.Printf(" %-11s %-32q\n", "RFC1123Z", "Mon, 02 Jan 2006 15:04:05 -0700")
fmt.Printf(" %-11s %-32q\n", "RFC3339", "2006-01-02T15:04:05Z07:00")
fmt.Printf(" %-11s %-32q\n", "Kitchen", "3:04PM")
fmt.Printf(" %-11s %-32q [Default]\n", "Stamp", "Mon Jan _2 15:04:05")
fmt.Printf(" %-11s %-32q\n", "StampMilli", "Jan _2 15:04:05.000")
fmt.Println("\nExit status:")
fmt.Println(" 0 if OK,")
fmt.Println(" 1 if minor problems (e.g., cannot access subdirectory),")
fmt.Println(" 2 if serious trouble (e.g., cannot access command-line argument).")
os.Exit(osExitCode)
}
// if f_V is provided version will be printed and exit(0)
if *f_V {
fmt.Printf("logo-ls %s\nCopyright (c) 2020 Yash Handa\nLicense MIT <https://opensource.org/licenses/MIT>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n", "v1.1.0")
fmt.Printf("logo-ls %s\nCopyright (c) 2020 Yash Handa\nLicense MIT <https://opensource.org/licenses/MIT>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n", "v1.3.5")
fmt.Println("\nWritten by Yash Handa")
os.Exit(osExitCode)
}
@@ -161,6 +181,25 @@ func main() {
flagVector |= flag_R
}
// set disable-git-status (-D) flag
if *f_D {
flagVector |= flag_D
}
// set disable-color (-c) flag
if *f_c {
flagVector |= flag_c
ctw.DisplayColor(false)
openDir = iDef["diropen"].getGlyph() + " "
}
// set disable-icon (-i) flag
if *f_i {
flagVector |= flag_i
openDir = ""
ctw.DisplayBrailEmpty(false)
}
// set -1 flag
if *f_1 {
flagVector |= flag_1
@@ -272,9 +311,11 @@ func main() {
}
// process and display all files
io.Copy(os.Stdout, newDir_ArgFiles(args.files).print())
if len(args.files) > 0 && len(args.dirs) > 0 {
fmt.Println()
if len(args.files) > 0 {
io.Copy(os.Stdout, newDir_ArgFiles(args.files).print())
if len(args.dirs) > 0 {
fmt.Println()
}
}
// process and display all the dirs in arg
@@ -284,14 +325,14 @@ func main() {
if i > 0 {
fmt.Println()
}
fmt.Printf("%s:\n", v.Name())
fmt.Printf("%s:\n", openDir+v.Name())
newDirs_Recussion(v)
}
} else {
pName := len(dirs) > 1
for i, v := range args.dirs {
if pName {
fmt.Printf("%s:\n", v.Name())
fmt.Printf("%s:\n", openDir+v.Name())
}
d, err := newDir(v)
v.Close()
@@ -306,7 +347,6 @@ func main() {
}
}
}
os.Exit(osExitCode)
}