A sample CLI tool made in V that prints geometric shapes to the screen.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Subhomoy Haldar 4eddf7d04a Bump version to 0.2.5 2 weeks ago
.github/workflows [Enhancement] Add CITATION.cff, Linters, and Maintain CI (#3) 2 months ago
geometry update test locations 2 years ago
.editorconfig follow official V init style 2 years ago
.gitattributes update .gitattributes 2 years ago
.gitignore Update .gitignore 5 months ago
CITATION.cff Bump version to 0.2.5 2 weeks ago
LICENSE Create LICENSE 2 years ago
README.md Fix CI badge 5 months ago
geo.v Run v fmt 5 months ago
help_text_test.v Use random executable names to avoid conflicts. 2 weeks ago
multi_option_test.v Use random executable names to avoid conflicts. 2 weeks ago
v.mod Bump version to 0.2.5 2 weeks ago

README.md

Geo

A sample CLI tool made in V that prints geometric shapes to the screen.

GitHub tag (latest SemVer) CI

Motivation

👉 Accompanying blog posts:

  1. The Complete Beginners Guide to CLI Apps in V
  2. Elevate Your V Project With Unit Tests
  3. Setting Up GitHub Actions for V

This project is meant to be a demonstration showcasing how easy it is to make a good CLI application with V. There is also an example to how to effectively structure a V project with modules and conduct unit tests.

Prerequisites

Instructions for installing the V language can be found here. For a brief introduction to V, refer the article: Getting Started with V.

Make sure to do v up to download and update to the latest version of V.

Usage

You can use v run . [OPTIONS] to run the tool while developing it. If you want a production build, you can use v -prod ., which will generate a binary file geo (or geo.exe on Windows) at the root of the repository.

To get started, try ./geo --help. It will print the following usage guide:

geo 0.2.x
-----------------------------------------------
Usage: geo [options] [ARGS]

Description: A sample CLI app for printing geometric shapes to the terminal.

Options:
  -p, --shape <string>      The shape to use for the geometry.
                            Allowed shapes are: left-triangle, right-triangle, pyramid, square, diamond
  -z, --size <int>          The size parameter for the shapes.
  -m, --symbol <string>     The symbol to use for the geometry.
  -h, --help                display this help and exit
  --version                 output version information and exit

Run Unit Tests

To run units tests, run this command at the root of this repository:

v test .

License

This work is licensed under the MIT license, see LICENSE for more details.

Mirrors

This project is hosted on GitHub: hungrybluedev/geo

As a backup, this repository is also available on Codeberg: hungrybluedev/geo

Contributors

  • @SheatNoisette - Idea, documentation, unit tests, and code improvement.
  • @hungrybluedev - Initial implementation, maintenance, and other chores.