Skip to main content

Smart file and directory viewer

Project description

L command

l コマンドは、 less のかわりにも ls のかわりにもなる新しいコマンドです。ファイルやディレクトリの中身をスマートに判別し、最適な方法で表示します。

Usage

  • l /path/to/file: ファイルの内容を適切な方法で表示します
    • ファイルが短い場合: cat として表示
    • ファイルが長い場合: less -RFX として表示
    • JSONファイルの場合: jq を使用して整形表示
  • l /path/to/directory: ls -la --color=auto /path/to/directory として働きます
  • l /path/to/json: JSONファイルを検出し、jq を使用して整形表示します

詳細な動作仕様

  • ファイルサイズや行数を自動判別し、短ければ cat、長ければ less を使用
  • ターミナルの高さを自動検出し、ファイルの行数がターミナルの高さを超える場合は less を使用
  • JSONファイルの自動検出と整形
    • 拡張子が .json のファイル
    • 拡張子がなくても、先頭部分が { または [ で始まるUTF-8ファイル
    • jq empty による構文チェックを行い、無効なJSONはデフォルト表示にフォールバック
    • 大きなJSONファイル(10MB以上)はデフォルト表示にフォールバック
  • ディレクトリの自動判別と一覧表示

オプション

現在はコマンドライン引数は以下のとおりです:

  • 位置引数 path: 表示するファイルまたはディレクトリのパス (デフォルト: カレントディレクトリ .)

ユースケース

  • 単に中身を見たい時に l file.txt
  • ディレクトリの内容を一目で確認したい時に l ./myfolder
  • JSONファイルを整形して読みたいとき l data.json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

l_command-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

l_command-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file l_command-0.1.0.tar.gz.

File metadata

  • Download URL: l_command-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for l_command-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbbed354a84a56462e08de6aed023ffbf7f2791f9e00113f68439d76b9814f66
MD5 f14e61ed5e40ccf83bf1a21311a96d1c
BLAKE2b-256 5a990e7d5d92ab02528d877794ddf114054873e8d7694eba60e7872eb1802117

See more details on using hashes here.

Provenance

The following attestation bundles were made for l_command-0.1.0.tar.gz:

Publisher: release.yml on gyu-don/l-command

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file l_command-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: l_command-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for l_command-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 601e2c08c8ddf9050d9be89934f7d287a7d6fb2799c426cff0c4b445994e1be9
MD5 2e6a097ac64b31b42b879dd4ffd9832b
BLAKE2b-256 0a30d59dbb345c3d934f0e45944c6bfd110cd1737364e81ed640288614f10f02

See more details on using hashes here.

Provenance

The following attestation bundles were made for l_command-0.1.0-py3-none-any.whl:

Publisher: release.yml on gyu-don/l-command

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page