Command line programs written in Zig.
 
 
 
 
Go to file
Jiacai Liu f1561defb0
fix latest
2023-08-11 08:29:40 +08:00
.github refactor(repeat): add interval, remove stdout pipe, use inherit. 2023-07-15 08:13:20 +08:00
src replace os.nanosleep with time.sleep 2023-07-15 17:19:35 +08:00
tests feat(loc): multi line comments support (#5) 2023-04-07 21:49:57 +08:00
.gitattributes add binary CI 2022-09-27 18:26:09 +08:00
.gitignore first init 2022-09-20 22:59:36 +08:00
.woodpecker.yml add mirror 2022-12-17 21:20:02 +08:00
LICENSE add LICENSE 2022-09-20 23:06:06 +08:00
Makefile remove sleep for windows 2023-07-15 10:01:35 +08:00
README.org feat: add repeat (#14) 2023-07-15 00:03:13 +08:00
build.zig fix latest 2023-08-11 08:29:40 +08:00
build.zig.zon refactor: add version support, pidof support user_only option 2023-06-29 20:22:41 +08:00

README.org

Zigcli

https://github.com/jiacai2050/loc/actions/workflows/CI.yml/badge.svg https://github.com/jiacai2050/loc/actions/workflows/binary.yml/badge.svg

Command line programs written in Zig. Currently there are:

  • loc, lines of code.
  • tree, list contents of directories in a tree-like format.
  • yes, output a string repeatedly until killed.
  • pidof, like pidof, but for macOS.
  • night-shift, control Night Shift in cli, build for macOS.
  • repeat, repeat a command until it succeeds.

Prebuilt binaries can be found in CI's artifacts, or you can build from source:

git clone https://github.com/jiacai2050/zigcli.git

Then build with

make build

To build zigcli locally, Zig master is required, which can be downloaded here.

Tree

./zig-out/bin/tree zig-out
zig-out
└──bin
   ├──loc
   ├──pidof
   ├──tree
   └──yes

1 directories, 4 files

Loc

./zig-out/bin/loc
Language File Line Code Comment Blank Size
-------- ---- ---- ---- ------- ----- -------
Zig      8    1427 1210 45      172   41.19K
YAML     6    195  182  5       8     5.03K
Makefile 1    12   8    0       4     206.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
-------- ---- ---- ---- ------- ----- -------
Total    18   1661 1414 58      189   46.81K

Night shift

./zig-out/bin/night-shift -h
 USAGE:
     ./zig-out/bin/night-shift [OPTIONS] [--] <command>

 Available commands by category:
 Manual on/off control:
   status                   View current Night Shift status
   on                       Turn Night Shift on
   off                      Turn Night Shift off
   toggle                   Toggle Night Shift

 Color temperature:
   temp                     View temperature preference
   temp  <0-100>            Set temperature preference

 Schedule:
   schedule                 View current schedule
   schedule sun             Start schedule from sunset to sunrise
   schedule off             Stop the current schedule
   schedule <from> <to>     Start a custom schedule(HH:mm, 24-hour format)

 OPTIONS:
	-v, --version                     Print version
	-h, --help                        Print help information

Roadmap

Loc

  • Performance, at least comparable with cgag/loc #1
  • More options, such as --exclude <regex>
  • Support multiline comment

License

Zigcli is licensed under the GPL 3.0 or later, see LICENSE for details.