Building your command line interface (CLR) tool with vlang on Windows

Zhihau Shiu
3 min readApr 22, 2022

When I am a student, I like the Linux course. The teacher teaches us how to type commands in a black screen. There is no colorful icons. Just boring text and black screen. We have to login into a remote Linux server in a terminal . Trying many commands. Afterward I know Linux equals these commands. Although there is a X Window, the teacher doesn’t teach that. I think it’s so simple, a mouse can easily use it.

Today I will make my mkdir command line interface tool with vlang. The command style likes GNU mkdir command. I will reference the common module. It contains many useful utility for building a GUI like's command. My mkdir command named md has been distinguished from the built-in mkdir command. Merely creating a folder is boring. The folder name can contains emoji. If I type and execute the Github emoji shortcode on the command line, it will convert this shortcode to an emoji unicode text. For example, the command is md :stuck_out_tongue:_Hello. After executed, it will create a folder named 😛_Hello.

Topics

  • Prepare vlang environment
  • Development

Prepare vlang environment

Download v_windows from V Programming Language. Extract the zip file. Go to the directory v_windows. Use the command v up updates source code to latest version. If it doesn't work, clone source code from the vlang repositoy. Afterward execute make.bat.

--

--

Zhihau Shiu

Hi! My name is Zhihau Shiu. I am a developer. I like to build some useful tool for myself. You can find them at Github.Zhihau.