options

Command line argument parser for MoonBit

CLI
argument parser
command line
moon add Milky2018/options@0.1.2
Download zip
Author
Version
0.1.2
License
Apache-2.0
Last updated
last year
Downloads
37

Dependencies

README

#Options: Command Line Argument Parser for MoonBit (Based on JSON)

Warning: it is for self-use and experimental, not for production.

If you are interested, check examples.

#
LeafCommand

pub(open) trait LeafCommand : ToJson +
FromJson
+ Default {
}

#
CommandParser

type CommandParser[T]

#
CommandParser::map

fn CommandParser::map[Sub, T](self : CommandParser[Sub], builder : (Sub) -> T) -> CommandParser[T]

#
CommandParser::parse

fn CommandParser::parse[T](self : CommandParser[T], args : Array[String]) -> T

#
CommandParser::parse_terminated

fn CommandParser::parse_terminated[T](self : CommandParser[T]) -> T

#
father

fn father[T](subs : Array[(String, CommandParser[T])]) -> CommandParser[T]

#
get_cli_args

fn get_cli_args() -> Array[String]

#
unit

fn unit() -> CommandParser[Unit]

#
unit_map

fn unit_map[T](builder : T) -> CommandParser[T]

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io