Skip to content

Latest commit

 

History

History
85 lines (62 loc) · 1.63 KB

README.md

File metadata and controls

85 lines (62 loc) · 1.63 KB

swapi-cli

A simple CLI written in Kotlin/Native to retrieve resources from The Star Wars API

Build

Prerequisites:

  • Java >= 8
  • cURL
  • ncurses5-compat-libs
./gradlew clean build

The binary executable swapi-cli.kexe will be generated in the dir build/bin/native/releaseExecutable.

Usage

The CLI expects the following command format:

./swapi-cli.kexe [resource] [operation] [param]
  • resource is the API resource to retrieve (people, films, starships, vehicles, species and planets)
  • operation is the operation to retrieve the resource (count, list, search and get)
  • param is only required for search and get operations

Examples

People:

./swapi-cli.kexe people count
./swapi-cli.kexe people list
./swapi-cli.kexe people search Luke
./swapi-cli.kexe people get 1

Films:

./swapi-cli.kexe films count
./swapi-cli.kexe films list
./swapi-cli.kexe films search Hope
./swapi-cli.kexe films get 1

Starships:

./swapi-cli.kexe starships count
./swapi-cli.kexe starships list
./swapi-cli.kexe starships search Star
./swapi-cli.kexe starships get 1

Vehicles:

./swapi-cli.kexe vehicles count
./swapi-cli.kexe vehicles list
./swapi-cli.kexe vehicles search Crawler
./swapi-cli.kexe vehicles get 1

Species:

./swapi-cli.kexe species count
./swapi-cli.kexe species list
./swapi-cli.kexe species search Rod
./swapi-cli.kexe species get 1

Planets:

./swapi-cli.kexe planets count
./swapi-cli.kexe planets list
./swapi-cli.kexe planets search Yavin
./swapi-cli.kexe planets get 1