A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
CBOR
、JSON
、YAML
..
-bash/zsh: tokei command not found # Alpine Linux (since 3.13) apk add tokei # Arch Linux pacman -S tokei # Cargo cargo install tokei # Conda conda install -c conda-forge tokei # Fedora sudo dnf install tokei # FreeBSD pkg install tokei # NetBSD pkgin install tokei # Nix/NixOS nix-env -i tokei # OpenSUSE sudo zypper install tokei
Tokei 是一个显示有关您的代码统计信息的程序。Tokei 基于 Rust 开发,可以将显示文件数量,这些文件中的总行数以及按语言分组的代码,注释和空白。效果如下:
=============================================================================== Language Files Lines Code Comments Blanks =============================================================================== BASH 4 49 30 10 9 JSON 1 1332 1332 0 0 Shell 1 49 38 1 10 TOML 2 77 64 4 9 ------------------------------------------------------------------------------- Markdown 5 1355 0 1074 281 |- JSON 1 41 41 0 0 |- Rust 2 53 42 6 5 |- Shell 1 22 18 0 4 (Total) 1471 101 1080 290 ------------------------------------------------------------------------------- Rust 19 3416 2840 116 460 |- Markdown 12 351 5 295 51 (Total) 3767 2845 411 511 =============================================================================== Total 32 6745 4410 1506 829 ===============================================================================
Tokei 在 Mac、Linux、Windows 上可用。请参阅安装说明,以了解如何在您的平台上获取 Tokei。Tokei 还是一个库,使您可以轻松地将其与其他项目集成。
目录或目标文件
这是使用 tokei 的基本方法。它将报告 ./foo 所有子文件夹中的代码。:
$ tokei ./foo
tokei 报告多个文件夹,只需添加一个逗号或一个空格,后跟另一个路径:
$ tokei ./foo ./bar ./baz $ tokei ./foo, ./bar, ./baz
tokei 也可以不含文件夹,比如忽略 .gitignore
和 .ignore
文件:
$ tokei ./foo --exclude *.rs
tokei 获取有关文件夹和所有子文件夹中的代码的报告:
tokei path/to/folder
tokei 获取不包含 .min.js
文件的文件夹的报告:
tokei path/to/folder -e *.min.js
tokei 打印出文件夹中单个文件的统计信息:
tokei path/to/folder --files
tokei 获取有关 Rust 和 Markdown 类型的所有文件的报告:
tokei path/to/folder -t=Rust,Markdown
Abap ActionScript Ada Agda Alex Alloy Asn1 Asp AspNet Assembly AssemblyGAS Autoconf AutoHotKey Automake Bash Batch BrightScript C Cabal Cassius Ceylon CHeader Clojure ClojureC ClojureScript CMake Cobol CoffeeScript Cogent ColdFusion ColdFusionScript Coq Cpp CppHeader Crystal CSharp CShell Css D DAML Dart DeviceTree Dhall Dockerfile DotNetResource DreamMaker Dust Edn Elisp Elixir Elm Elvish EmacsDevEnv Emojicode Erlang FEN Fish FlatBuffers Forth FortranLegacy FortranModern FreeMarker FSharp Fstar GDB GdScript Gherkin Gleam Glsl Go Graphql Groovy Gwion Hamlet Handlebars Happy Haskell Haxe Hcl Hex Hlsl HolyC Html Idris Ini IntelHex Isabelle Jai Java JavaScript Json Jsx Julia Julius KakouneScript Kotlin Lean Less LinkerScript Liquid Lisp LLVM Logtalk Lua Lucius Madlang Makefile Markdown Meson Mint ModuleDef MoonScript MsBuild Mustache Nim Nix NotQuitePerl ObjectiveC ObjectiveCpp OCaml Odin Org Oz Pascal Perl Perl6 Pest Php Polly Pony PostCss PowerShell Processing Prolog Protobuf PSL PureScript Python Qcl Qml R Racket Rakefile Razor Renpy ReStructuredText RON RPMSpecfile Ruby RubyHtml Rust Sass Scala Scheme Scons Sh Sml Solidity SpecmanE Spice Sql SRecode Stratego Svelte Svg Swift Swig SystemVerilog Tcl Tex Text Thrift Toml Tsx Twig TypeScript UnrealDeveloperMarkdown UnrealPlugin UnrealProject UnrealScript UnrealShader UnrealShaderHeader UrWeb UrWebProject Vala VB6 VBScript Velocity Verilog VerilogArgsFile Vhdl VimScript VisualBasic VisualStudioProject VisualStudioSolution Vue WebAssembly Wolfram Xaml XcodeConfig Xml XSL Xtend Yaml Zig Zsh