Skip to content

Commit

Permalink
Merge pull request #74 from ravsii/feat/json-print
Browse files Browse the repository at this point in the history
Feature: better JSON output
  • Loading branch information
pouriyajamshidi authored May 14, 2023
2 parents 4ddcbb7 + e64c393 commit 8d4aa31
Show file tree
Hide file tree
Showing 9 changed files with 256 additions and 144 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*.sh
executables/
.idea/
tcping
.DS_Store
.vscode
*.code-workspace
Binary file added Images/gifs/tcping_json_pretty.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions Images/tapes/tcping_json_pretty.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Set Shell "bash"
Set FontSize 16
Set Width 1300
Set Height 1000

Type "./tcping example.com 80 -j --pretty"
Sleep 500ms Enter

Sleep 10s Ctrl+C

Sleep 10s
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,8 @@ gifs:

@echo "[+] Making tcping_resolve.gif"
@vhs $(TAPE_DIR)tcping_resolve.tape -o $(GIFS_DIR)tcping_resolve.gif
@echo "[+] Done"

@echo "[+] Making tcping_json_pretty.gif"
@vhs $(TAPE_DIR)tcping_json_pretty.tape -o $(GIFS_DIR)tcping_json_pretty.gif
@echo "[+] Done"
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ TCPING uses different `TCP sequence numbering` for successful and unsuccessful p

### Retry resolve (`-r`) flag

![tcping](Images/gifs/tcping_resolve.gif)
![tcping resolve example](Images/gifs/tcping_resolve.gif)

---

### Pretty json output (`-j --pretty`)

![tcping json example](Images/gifs/tcping_json_pretty.gif)

---

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/sys v0.8.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
Loading

0 comments on commit 8d4aa31

Please sign in to comment.