ITZone

Philosophy about CLI app

Preamble

The CLI App stands for Command Line Interface App , which is the app used on the terminal. Perhaps those who are familiar with the system running on unix will be more familiar with CLI than those who are using window machines. The author is unix user, so the article will be based on concepts that are more or less familiar to those who have been using unix.

Philosophy about CLI app

Unix's built-in tools such as top, find … are all considered CLI apps. To find out how an app runs, you usually use the man command . For example, the result from the man of the top command is the command to find out the parameters related to the system used

Try some other commands like find or awk , you can see some very "homogeneous" features of the CLI app:

Standards

Refer to the example above the grep statement, you can see that a regular CLI app has 3 parts

Options usually called flag. Perhaps you have used the CLI app familiarity to know that there is not only one type, there may be "2 bricks" (eg: -xy ), there may be "1 tile" (eg -xy ), yes There can be 2 tiles and there is no value (eg ). You will be confused and do not understand where those writing methods come from.

There is a norm (or more correctly recommended rules) from GNU and POSIX that stipulate the "style" and "meaning" of flags for the CLI app located at:

These standards can be summarized, including

Conclude

Maybe a bit of the theory above is enough for you to write a "good" CLI for yourself and for others: D.

Happy hacking

Huydx writer

ITZone via kipalog

Share the news now