Skip to content

Argument parsing, validation from manifest preamble #106

@homonoidian

Description

@homonoidian

Like in Python docopt, runtime gets arguments as words (or in an args block for instance, as in args.filename, or args.optlevel, etc.) How the usage should be parsed out I have no idea at the moment, but it's perfectly doable of course. The syntax is yet to be clarified.

nolayout
hello.nk
---
Some help message stuff...

Usage:
   --  <filename> [optlevel]

Some more help message stuff...

And in hello.nk for instance:

'Filename: ' args.filename ~ echo
args.optlevel? => [ 'Optlevel:' _ echo ]

"It'd be nice to automatically define ( -- V true / false ) to get the Value of an optional parameter"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions