• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.vscode/H03-May-2022-4949

aur/H03-May-2022-8153

cargo-crates/H03-May-2022-617,485505,610

img/H03-May-2022-

sed/H03-May-2022-425369

src/H03-May-2022-1,7411,197

.cargo_vcs_info.jsonH A D01-Oct-202074 65

.gitignoreH A D18-Jun-2020392 1511

Cargo.lockH A D01-Oct-202013 KiB524466

Cargo.tomlH A D01-Oct-20201.5 KiB4539

LICENSEH A D18-Jun-202034.3 KiB675553

README.mdH A D01-Oct-20203.7 KiB11371

desed.1H A D26-Jul-20202.1 KiB8483

publish.shH A D18-Jun-2020324 96

README.md

1# Desed
2Demystify and debug your sed scripts, from comfort of your terminal.
3
4![desed usage example](img/desed.gif)
5
6Desed is a command line tool with beautiful TUI that provides users with comfortable interface and practical debugger, used to step through complex sed scripts.
7
8Some of the notable features include:
9
10- Preview variable values, both of them!
11- See how will a substitute command affect pattern space before it runs
12- Step through sed script - both forward and backwards!
13- Place breakpoints and examine program state
14- Hot reload and see what changes as you edit source code
15- Its name is a palindrome
16
17## Install
18
19### Arch Linux
20
21Via AUR: [desed-git](https://aur.archlinux.org/packages/desed-git/) or [desed](https://aur.archlinux.org/packages/desed/) as stable version.
22
23### DragonFly BSD
24
25```sh
26pkg install desed
27```
28
29### Fedora
30
31```sh
32dnf install desed
33```
34
35### FreeBSD
36
37```sh
38pkg install desed
39```
40
41### Void Linux
42
43```sh
44xbps-install -S desed
45```
46
47### Source
48
49```sh
50git clone https://github.com/soptikha2/desed
51cd desed
52cargo install --path .
53cp "desed.1" "$(manpath | cut -d':' -f1)/man1"
54```
55
56### Cargo
57
58```
59cargo install desed
60```
61
62### Precompiled binaries
63
64See [releases](https://github.com/SoptikHa2/desed/releases).
65
66### Dependencies:
67
68Development: `rust`, `cargo` (>= 1.38.0)
69
70Runtime: `sed` (GNU version, >= 4.6) (desed works on BSD if you installed `gsed`)
71
72## Controls
73
74- Mouse scroll to scroll through source code, click on line to toggle breakpoint
75- `j`, `k`, `g`, `G`, just as in Vim. Prefixing with numbers works too.
76- `b` to toggle breakpoint (prefix with number to toggle breakpoint on target line)
77- `s` to step forward, `a` to step backwards
78- `r` to run to next breakpoint or end of script, `R` to do the same but backwards
79- `l` to instantly reload code and continue debugging in the exactly same place as before
80- `q` to [quit](https://github.com/hakluke/how-to-exit-vim)
81
82# FAQ
83
84## How does it work?
85GNU sed actually provides pretty useful debugging interface, try it yourself with `--debug` flag. However the interface is not interactive and I wanted something closer to traditional debugger. [I've written something here](https://soptik.tech/articles/building-desed-the-sed-debugger.html).
86
87## Does it really work?
88Depends. Sed actually doesn't tell me which line number is it currently executing, so I have to emulate parts of sed to guess that. Which might not be bulletproof. But it certainly worked good enough to debug tetris without issues.
89
90## Why sed??
91
92Sed is the perfect programming language, [especially for graph problems](https://tildes.net/~comp/b2k/programming_challenge_find_path_from_city_a_to_city_b_with_least_traffic_controls_inbetween#comment-2run). It's plain and simple and doesn't clutter your screen with useless identifiers like `if`, `for`, `while`, or `int`. Furthermore since it doesn't have things like numbers, it's very simple to use.
93
94## But why?
95
96I wanted to program in sed but it lacked good tooling up to this point, so I had to do something about it.
97
98## Why?
99
100Because it's the standard stream editor for filtering and transforming text. And someone wrote [tetris](https://github.com/uuner/sedtris) in it!
101
102## What is the roadmap for future updates?
103
104I would like to introduce syntax highlighting and add this tool to standard repositories of all major distributions.
105
106## Is this a joke?
107
108I thought it was. But apparently it's actually useful for some people.
109
110# Other projects
111
112- [video summarizer](https://github.com/soptikha2/video-summarizer), a tool and browser extensions that determines if people in video are currently talking or not, and speeds up the video accordingly. Great for long lecture videos for skipping time spent writing on a whiteboard.
113