v/vlib/cli
Tim Basel d16721e5b8
cli: remove flags.get_*_or variants (#8102)
2021-01-17 05:33:39 +01:00
..
README.md
command.v
command_test.v
flag.v cli: remove flags.get_*_or variants (#8102) 2021-01-17 05:33:39 +01:00
flag_test.v cli: remove flags.get_*_or variants (#8102) 2021-01-17 05:33:39 +01:00
help.v
version.v

README.md

Usage example:

module main

import os
import cli

fn main() {
	mut app := cli.Command{
		name: 'example-app'
		description: 'example-app'
		execute: fn (cmd cli.Command) ? {
			println('hello app')
			return
		}
		commands: [
			cli.Command{
				name: 'sub'
				execute: fn (cmd cli.Command) ? {
					println('hello subcommand')
					return
				}
			},
		]
	}
	app.setup()
	app.parse(os.args)
}