misc/importsort-d

v0.1.0
Repositories | Summary | Log | Files | README.md

Branches

NameLast commit dateAuthor
master at "Someone sneakily renamed ..."2023-12-23 22:53Friedel Schön

Tags

NameLast commit dateAuthor
v0.3.2 at "update readme"2023-12-23 20:44Friedel Schön
v0.3.1 at "added documentation"2022-10-23 13:51Friedel Schoen
v0.3.0 at "adding --merge"2022-10-22 21:56Friedel Schoen
v0.2.0 at "implementing --recursive, ..."2022-10-18 20:51Friedel Schoen
v0.1.0 at "fixing standalone-import's ..."2022-10-10 13:28Friedel Schön

About

# Sort Imports for [D](https://dlang.org/)

`sortimport-d` can sort your dozens of `import`'s in a `.d` file (no matter where)

## Installation

### Prerequirements

- [`dub`](https://dub.pm/)
- [`dmd`](https://dlang.org/)

### Building

Get the repository with `git` and compile everything with `dub`
```
$ git clone https://github.com/friedelschoen/importsort-d
$ cd importsort-d
$ dub build
```

If everything went fine, there should be a binary at `bin/importsort-d`.

Copy this into a directory included in `$PATH` (`/usr/bin` for example) to make this command working global.

## Usage

```
$ importsort-d [--inline [--keep]] [--out <output>] [--original] [--special] [<input>]
```

> `input` may be omitted or set to `-` to read from STDIN

| option                | description                                    |
| --------------------- | ---------------------------------------------- |
| `-i, --inline`        | changes the input                              |
| `-k, --keep`          | keeps a backup of the input                    |
| `-o, --output <path>` | writes to `path` rather then writing to STDOUT |
| -                     |                                               |
| `-r, --original`      | sorts by original rather then the binding      |
| `-s, --special`       | public and static imports first                |


## License

This whole project is licensed under the beautiful terms of the `zlib-license`.

Further information [here](LICENSE)

> made with love and a lot of cat meme