Skip to content

Commit

Permalink
add verbose flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Sep 1, 2024
1 parent 94cc8f5 commit 2b44ef3
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 123 deletions.
6 changes: 1 addition & 5 deletions docs/content/programs/_index.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#+TITLE: Programs
#+DATE: 2023-10-21T12:26:45+0800
#+LASTMOD: 2024-08-17T18:17:57+0800
#+LASTMOD: 2024-09-01T09:57:50+0800
#+TYPE: docs
#+WEIGHT: 20
#+DESCRIPTION: Binary programs which can be used directly
Expand All @@ -15,8 +15,4 @@ Then build with
make build
#+end_src

#+begin_quote
To build zigcli locally, Zig master is required, which can be downloaded [[https://ziglang.org/download/][here]].
#+end_quote

* Available Programs
14 changes: 9 additions & 5 deletions docs/content/programs/dark-mode.org
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#+TITLE: dark-mode
#+DATE: 2024-08-17T17:52:00+0800
#+LASTMOD: 2024-08-17T19:01:59+0800
#+LASTMOD: 2024-09-01T11:59:08+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu
#+DESCRIPTION: Configuring "Dark mode" for macOS.

#+begin_src bash
$ dark-mode -h
#+begin_src bash :results verbatim :exports results :wrap example :dir ../../..
./zig-out/bin/dark-mode -h
#+end_src

#+RESULTS:
#+begin_example
USAGE:
dark-mode [OPTIONS] [--] <command>
./zig-out/bin/dark-mode [OPTIONS] [--] <command>

Available commands:
status View dark mode status
Expand All @@ -19,4 +23,4 @@
OPTIONS:
-v, --version Print version
-h, --help Print help information
#+end_src
#+end_example
40 changes: 21 additions & 19 deletions docs/content/programs/loc.org
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
#+TITLE: loc
#+DATE: 2024-08-17T17:52:51+0800
#+LASTMOD: 2024-08-17T18:57:02+0800
#+LASTMOD: 2024-09-01T11:49:49+0800
#+TYPE: docs
#+DESCRIPTION: Lines of code

#+begin_src bash :results verbatim code :exports both
#+begin_src bash :results verbatim :exports result :dir ../../..
./zig-out/bin/loc
#+end_src

#+RESULTS:
#+begin_src bash
┌───────────┬───────┬───────┬───────┬──────────┬────────┬──────────┐
│Language │File │Line │Code │Comment │Blank │Size │
├───────────┼───────┼───────┼───────┼──────────┼────────┼──────────┤
│Zig │13 │2774 │2362 │84 │328 │83.41K │
│YAML │8 │321 │298 │5 │18 │7.95K │
│TOML │1 │30 │24 │0 │6 │541.00B │
│Makefile │1 │22 │15 │0 │7 │354.00B │
│Markdown │3 │16 │15 │0 │1 │240.00B │
│Python │1 │10 │7 │2 │1 │166.00B │
│C │1 │9 │2 │4 │3 │34.00B │
│Ruby │1 │8 │5 │2 │1 │201.00B │
│JSON │1 │1 │1 │0 │0 │188.00B │
├───────────┼───────┼───────┼───────┼──────────┼────────┼──────────┤
│Total │30 │3191 │2729 │97 │365 │93.04K │
└───────────┴───────┴───────┴───────┴──────────┴────────┴──────────┘
#+end_src
#+begin_example
┌───────────┬───────┬────────┬───────┬──────────┬────────┬──────────┐
│Language │File │Line │Code │Comment │Blank │Size │
├───────────┼───────┼────────┼───────┼──────────┼────────┼──────────┤
│Zig │363 │10808 │9369 │1050 │389 │632.19K │
│YAML │8 │317 │292 │4 │21 │7.84K │
│TOML │1 │32 │27 │0 │5 │698.00B │
│Makefile │1 │23 │16 │0 │7 │365.00B │
│Python │1 │10 │7 │2 │1 │166.00B │
│C │1 │9 │2 │4 │3 │34.00B │
│Ruby │1 │8 │5 │2 │1 │201.00B │
│Markdown │1 │5 │5 │0 │0 │102.00B │
│CHeader │1 │2 │2 │0 │0 │44.00B │
│JSON │2 │2 │2 │0 │0 │247.00B │
├───────────┼───────┼────────┼───────┼──────────┼────────┼──────────┤
│Total │380 │11216 │9727 │1062 │427 │641.84K │
└───────────┴───────┴────────┴───────┴──────────┴────────┴──────────┘

#+end_example
8 changes: 4 additions & 4 deletions docs/content/programs/night-shift.org
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#+TITLE: night-shift
#+DATE: 2024-08-17T17:52:12+0800
#+LASTMOD: 2024-08-17T19:01:46+0800
#+LASTMOD: 2024-09-01T11:59:23+0800
#+TYPE: docs
#+DESCRIPTION: Configuring "Night Shift" for macOS. 🌕🌖🌗🌘🌑

#+begin_src bash :results verbatim code :exports both
#+begin_src bash :results verbatim :exports results :wrap example :dir ../../..
./zig-out/bin/night-shift -h
#+end_src

#+RESULTS:
#+begin_src bash
#+begin_example
USAGE:
./zig-out/bin/night-shift [OPTIONS] [--] <command>

Expand All @@ -33,7 +33,7 @@
OPTIONS:
-v, --version Print version
-h, --help Print help information
#+end_src
#+end_example

* Acknowledgment
- https://github.com/smudge/nightlight
12 changes: 8 additions & 4 deletions docs/content/programs/pidof.org
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#+TITLE: pidof
#+DATE: 2024-08-17T17:52:44+0800
#+LASTMOD: 2024-08-17T18:57:58+0800
#+LASTMOD: 2024-09-01T11:56:51+0800
#+TYPE: docs
#+DESCRIPTION: Linux has this command, but not macOS, so I write it for you.

#+begin_src bash
$ ./zig-out/bin/pidof -h
#+begin_src bash :results verbatim :exports results :wrap example :dir ../../..
./zig-out/bin/pidof -h
#+end_src

#+RESULTS:
#+begin_example
USAGE:
./zig-out/bin/pidof [OPTIONS] [--] [program]

Expand All @@ -15,4 +19,4 @@ $ ./zig-out/bin/pidof -h
-u, --user_only Only show process belonging to current user.
-v, --version Print version.
-h, --help Print help message.
#+end_src
#+end_example
20 changes: 12 additions & 8 deletions docs/content/programs/repeat.org
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
#+TITLE: repeat
#+DATE: 2024-08-17T17:52:32+0800
#+LASTMOD: 2024-08-17T18:58:53+0800
#+LASTMOD: 2024-09-01T11:57:51+0800
#+TYPE: docs
#+DESCRIPTION: Execute a command repeatly until it succeeds.

#+begin_src bash
$ ./zig-out/bin/repeat -h
#+begin_src bash :results verbatim :exports results :wrap example :dir ../../..
./zig-out/bin/repeat -h
#+end_src

#+RESULTS:
#+begin_example
USAGE:
./zig-out/bin/repeat [OPTIONS] [--] command

OPTIONS:
-m, --max INTEGER Max times to repeat
-i, --interval INTEGER Pause interval(in seconds) between repeats
-v, --version Print version
-h, --help Print help information
#+end_src
-m, --max INTEGER Max times to repeat
-i, --interval INTEGER Pause interval(in seconds) between repeats
-v, --version Print version
-h, --help Print help information
#+end_example
8 changes: 4 additions & 4 deletions docs/content/programs/tcp-proxy.org
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#+TITLE: tcp-proxy
#+DATE: 2024-09-01T00:02:43+0800
#+LASTMOD: 2024-09-01T00:14:17+0800
#+LASTMOD: 2024-09-01T11:57:00+0800
#+TYPE: docs
#+DESCRIPTION: Forward TCP requests hitting a specified port on the localhost to a different port on another host

Both IPv4 and IPv6 are supported.

#+begin_src bash :results verbatim :exports result :dir ../../..
#+begin_src bash :results verbatim :exports results :wrap example :dir ../../..
./zig-out/bin/tcp-proxy -h
#+end_src

Expand All @@ -16,12 +16,12 @@ Both IPv4 and IPv6 are supported.
./zig-out/bin/tcp-proxy [OPTIONS]

OPTIONS:
-b, --bind_address STRING Local bind address(required)
-b, --bind_host STRING Local bind host(required)
-p, --local_port INTEGER Local bind port(required)
-H, --remote_host STRING Remote host(required)
-P, --remote_port INTEGER Remote port(required)
--buf_size INTEGER Buffer size for tcp read/write(default: 1024)
--thread_pool_size INTEGER (default: 24)
--server_threads INTEGER Server worker threads num(default: 24)
-h, --help
-v, --version
--verbose
Expand Down
28 changes: 15 additions & 13 deletions docs/content/programs/tree.org
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#+TITLE: tree
#+DATE: 2024-08-17T17:52:22+0800
#+LASTMOD: 2024-08-17T19:02:08+0800
#+LASTMOD: 2024-09-01T11:56:26+0800
#+TYPE: docs
#+DESCRIPTION: Display the directory structure of a path in a tree-like format

#+begin_src
$ ./zig-out/bin/tree -h
#+begin_src bash :results verbatim :exports results :wrap example :dir ../../..
./zig-out/bin/tree -h
#+end_src

#+RESULTS:
#+begin_example
USAGE:
./zig-out/bin/tree [OPTIONS] [--] [directory]

OPTIONS:
-m, --mode STRING Line drawing characters. (valid: ascii|box|dos)(default: box)
-a, --all All files are printed.
-s, --size Print the size of each file in bytes along with the name.
-d, --directory List directories only.
-L, --level INTEGER Max display depth of the directory tree.
-v, --version Print version.
-h, --help Print help information.


#+end_src
-m, --mode STRING Line drawing characters. (valid: ascii|box|dos)(default: box)
-a, --all All files are printed.
-s, --size Print the size of each file in bytes along with the name.
-d, --directory List directories only.
-L, --level INTEGER Max display depth of the directory tree.
-v, --version Print version.
-h, --help Print help information.
#+end_example

** Demo
#+begin_src bash
Expand Down
Loading

0 comments on commit 2b44ef3

Please sign in to comment.