All Projects → leprosus → Kotlin Cli

leprosus / Kotlin Cli

Licence: mit
Kotlin-CLI - command line interface options parser for Kotlin

Programming Languages

kotlin
9241 projects

Labels

Projects that are alternatives of or similar to Kotlin Cli

Planet Gee Pipeline Cli
Planet and Google Earth Engine Pipeline Command Line Interface Tool
Stars: ✭ 35 (-5.41%)
Mutual labels:  cli
Mythra
Music retrieval CLI and API using rust
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Rocket.chat.apps Cli
The CLI for interacting with Rocket.Chat Apps
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Langterm
🕹️ WebGL-based VT220 emulator, made as a learning example and frontend for a text adventure
Stars: ✭ 35 (-5.41%)
Mutual labels:  cli
Lyft
Create and manage Lyft rides from the command line
Stars: ✭ 36 (-2.7%)
Mutual labels:  cli
Spinnercpp
Simple header only library to add a spinner / progress indicator to any terminal application.
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Gitviper
Enhanced git experience using the command line
Stars: ✭ 35 (-5.41%)
Mutual labels:  cli
Kubetop
Kubernetes nodes, pods, services, and deployments in a glance
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Football Cli
⚽ Command line interface for Hackers who love football
Stars: ✭ 984 (+2559.46%)
Mutual labels:  cli
Fuego
fuego is a library for automatically generating command line interfaces (CLIs) from function and struct.
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Judge
Online Judge Kernel,Virtual Judge Adapter,Command-Line Interface, Telnet Server, FTP Server
Stars: ✭ 35 (-5.41%)
Mutual labels:  cli
Composify
Turn WordPress plugin zip files into git repositories, so that composer version constraints work properly.
Stars: ✭ 36 (-2.7%)
Mutual labels:  cli
Cli
GraphQL back-end framework with first-class Typescript support
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Moviescore
A cli tool to get movie ratings and reviews directly to your terminal!
Stars: ✭ 35 (-5.41%)
Mutual labels:  cli
Create Wxapp Page
创建微信小程序页面的命令行工具
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Cbrcli
Command line interface to Carbon Black Response
Stars: ✭ 35 (-5.41%)
Mutual labels:  cli
Gomodctl
Search, Check, and Update Go modules.
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Simplifyify
A simplified Browserify and Watchify CLI
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Usacloud
usacloud🐰 : CLI client for the Sakura Cloud🌸☁️
Stars: ✭ 37 (+0%)
Mutual labels:  cli
Sqlite Global Tool
SQLite .NET Core CLI tool that allows the user to manually enter and execute SQL statements with or without showing query result.
Stars: ✭ 37 (+0%)
Mutual labels:  cli

kotlin-cli

Kotlin-CLI - command line option parsing suite for Kotlin

Usage

import com.evalab.core.cli.Command
import com.evalab.core.cli.exception.OptionException

fun main(args: Array<String>) {
    val command = Command("command", "Command just for testing")

    command.addBooleanOption("debug", false, 'd', "Flag of debug mode")
    command.addBooleanOption("verbose", false, 'v', "Returns detailed information")
    command.addIntegerOption("size", false, 's', "Sets size")
    command.addDoubleOption("fraction", false, 'f', "Sets fraction")
    command.addStringOption("name", true, 'n', "Sets name")

    try {
        command.parse(args)
    } catch (e: OptionException) {
        println(e.message)
        println(command.getHelp())
        System.exit(2)
    }

    val debug = command.getBooleanValue("debug", false)
    val verbose = command.getBooleanValue("verbose", false)
    val size = command.getIntegerValue("size", 0)
    val fraction = command.getDoubleValue("fraction", 0.0)
    val name = command.getStringValue("name")

    println("debug: " + debug)
    println("verbose: " + verbose)
    println("size: " + size)
    println("fraction: " + fraction)
    println("name: " + name)
}

Contact

Follow me @leprosus

License

MIT License. See the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].