tokei/README.md

185 lines
4.1 KiB
Markdown
Raw Normal View History

2016-02-03 16:20:16 +00:00
# Tokei ([時計](https://en.wiktionary.org/wiki/%E6%99%82%E8%A8%88))
2015-05-26 21:19:00 +00:00
2015-09-21 22:56:13 +00:00
[![GitHub License](https://img.shields.io/github/license/Aaronepower/tokei.svg)](http://github.com/Aaronepower/tokei/blob/master/LICENSE)
2015-09-22 10:10:13 +00:00
[![](https://img.shields.io/github/release/Aaronepower/tokei.svg)](https://github.com/Aaronepower/tokei/releases/tag/1.1.1/)
2015-09-22 09:15:20 +00:00
[![](https://img.shields.io/travis/Aaronepower/tokei.svg)](https://travis-ci.org/Aaronepower/tokei)
2016-05-16 17:25:38 +00:00
[![](https://img.shields.io/crates/d/tokei.svg)](https://crates.io/crates/tokei)
2015-09-21 22:56:13 +00:00
[![](https://img.shields.io/github/issues-raw/Aaronepower/tokei.svg)](http://github.com/Aaronepower/tokei/issues)
2015-09-20 09:47:28 +00:00
2015-09-28 22:26:17 +00:00
A blazingly fast CLOC(Count Lines Of Code) program, written in Rust.
2016-02-07 11:25:53 +00:00
## Canonical Source
2016-05-02 08:54:39 +00:00
The canonical source of this repo is hosted on [GitHub](https://github.com/Aaronepower/tokei). If you have a GitHub account, please make your issues, and pull requests there.
2016-02-07 11:25:53 +00:00
2015-09-21 22:56:13 +00:00
## Installation
### Automatic
2016-01-24 17:12:17 +00:00
If you have [`cargo 0.6.0>=`](https://www.rust-lang.org/downloads.html) installed just run the `cargo install` command.
2016-05-15 20:32:48 +00:00
```shell
$ cargo install tokei
```
### Manual
#### Fedora 64 bit
2015-09-22 02:47:59 +00:00
Install rust and cargo from either the [official page](https://www.rust-lang.org) or use a copr repo such as [Rust](https://copr.fedoraproject.org/coprs/phnxrbrn/rust/)
2016-05-15 20:32:48 +00:00
```shell
2016-02-04 00:11:06 +00:00
$ dnf copr enable phnxrbrn/tokei
$ dnf install tokei
```
2015-09-20 09:47:28 +00:00
#### Other
2016-05-15 20:32:48 +00:00
```shell
2016-02-04 00:11:06 +00:00
$ git clone https://github.com/Aaronepower/tokei.git
$ cd tokei
$ cargo build --release
```
##### Linux
2016-02-04 00:11:06 +00:00
```
# sudo mv target/release/tokei /usr/local/bin
```
##### OSX
2016-02-04 00:11:06 +00:00
```
# sudo mv target/release/tokei /usr/local/bin/tokei
```
##### Windows
2015-09-20 09:47:28 +00:00
- Create a folder for tokei
2015-09-21 22:56:13 +00:00
- search for `env`
2015-09-20 09:47:28 +00:00
- open "edit your enviroment variables"
2015-09-20 11:01:22 +00:00
- edit `PATH`
2016-02-04 00:11:06 +00:00
- append folder path to the end of the string ie: `<path_stuff_here>;C:/tokei/;`
2015-09-20 09:47:28 +00:00
2015-09-21 22:56:13 +00:00
## Usage
To use tokei, use must add it to your path. Then you can call tokei like so
2016-02-04 00:11:06 +00:00
2016-05-15 20:32:48 +00:00
```shell
2016-02-04 00:11:06 +00:00
$ tokei ./path/to/code
```
2015-09-21 22:56:13 +00:00
## Options
```
2016-05-23 11:02:07 +00:00
Tokei 2.1.1
Aaron P. <theaaronepower@gmail.com>
2016-05-23 11:02:07 +00:00
Count Code, Quickly.
2015-05-26 21:19:00 +00:00
USAGE:
2016-05-15 20:32:48 +00:00
Tokei [FLAGS] [OPTIONS] <input>...
2015-05-26 21:19:00 +00:00
FLAGS:
2016-05-23 11:02:07 +00:00
-f, --files Will print out statistics on individual files.
-h, --help Prints help information
2016-05-23 11:02:07 +00:00
-l, --languages Prints out supported languages and their extensions
-V, --version Prints version information
OPTIONS:
2016-05-23 11:02:07 +00:00
-e, --exclude <exclude> Ignore all files & directories containing the word
-i, --input <file_input> Gives statistics from a previous tokei run. Can be given a file path, or "stdin" to read from stdin
-o, --output <output> Outputs Tokei in a specific format. [values: cbor, json, yaml]
-s, --sort <sort> Will sort based on column [values: files, total, blanks, code, comments]
ARGS:
2016-05-15 20:32:48 +00:00
<input>... The input file(s)/directory(ies)
```
2015-09-21 22:56:13 +00:00
## Supported Languages
2015-09-20 10:09:03 +00:00
If there is a language that you want added submit a pull request with the following information
- Name of language
2016-05-15 20:32:48 +00:00
- File Extension
- The comment syntax (_Does it have block comments? is it the same as C?_)
2015-09-20 10:09:03 +00:00
```
2015-10-27 10:05:06 +00:00
ActionScript
2016-03-26 14:44:49 +00:00
Assembly
2015-10-27 10:05:06 +00:00
BASH
Batch
C
2016-03-26 14:44:49 +00:00
C Header
2015-10-27 10:05:06 +00:00
Clojure
CoffeeScript
2016-03-26 14:44:49 +00:00
ColdFusion
ColdFusion CFScript
2016-05-15 20:32:48 +00:00
Coq
C++
C++ Header
C#
C Shell
CSS
2015-10-27 10:05:06 +00:00
D
Dart
2016-03-26 14:44:49 +00:00
Device Tree
2016-05-15 20:32:48 +00:00
Erlang
2015-10-27 10:05:06 +00:00
FORTRAN Legacy
FORTRAN Modern
Go
2016-03-26 14:44:49 +00:00
Haskell
2016-05-15 20:32:48 +00:00
HTML
Idris
2015-10-27 10:05:06 +00:00
JAI
2016-03-26 14:44:49 +00:00
Java
JavaScript
Julia
2016-05-15 20:32:48 +00:00
JSON
JSX
Kotlin
2015-10-27 10:05:06 +00:00
LESS
2016-05-15 20:32:48 +00:00
LD Script
2016-03-26 14:44:49 +00:00
LISP
2016-02-03 16:22:06 +00:00
Lua
2016-03-26 14:44:49 +00:00
Makefile
2016-02-03 16:22:06 +00:00
Markdown
2016-05-15 20:32:48 +00:00
Mustache
Nim
2016-03-26 14:44:49 +00:00
Objective C
Objective C++
2016-05-15 20:32:48 +00:00
OCaml
Oz
2016-03-26 14:44:49 +00:00
Pascal
2015-10-27 10:05:06 +00:00
Perl
2016-03-26 14:44:49 +00:00
Polly
2016-05-15 20:32:48 +00:00
PHP
Protocol Buffers
Prolog
2015-10-27 10:05:06 +00:00
Python
2016-05-15 20:32:48 +00:00
QCL
2015-10-27 10:05:06 +00:00
R
Ruby
Ruby HTML
Rust
Sass
2016-02-03 16:22:06 +00:00
Standard ML
2016-05-15 20:32:48 +00:00
SQL
2015-10-27 10:05:06 +00:00
Swift
2016-03-26 14:44:49 +00:00
TeX
2016-05-15 20:32:48 +00:00
Plain Text
TOML
2015-10-27 10:05:06 +00:00
TypeScript
2016-05-15 20:32:48 +00:00
Vim Script
Unreal Script
Wolfram
2015-10-27 10:05:06 +00:00
XML
YAML
2016-05-15 20:32:48 +00:00
Zsh
```
2015-09-20 10:09:03 +00:00
2015-09-21 22:56:13 +00:00
## Common issues
2015-09-20 10:09:03 +00:00
2016-03-27 17:07:55 +00:00
## Tokei says I have a lot of D code, but I know there is no D code!
This is likely due to `gcc` generating `.d` files. Until the D people decide on a different file extension, you can always exclude `.d` files using the `-e --exclude` flag like so
2015-09-20 10:09:03 +00:00
```
2016-03-27 17:07:55 +00:00
$ tokei . -e .d
2015-09-20 10:09:03 +00:00
```
2015-09-21 22:56:13 +00:00
## Copyright and License
(C) Copyright 2015 by Aaron Power and contributors
See CONTRIBUTORS.md for a full list of contributors.
Tokei is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
2015-09-21 22:56:13 +00:00
See [LICENCE-APACHE](./LICENCE-APACHE), [LICENCE-MIT](./LICENCE-MIT) for more information.