hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit b51e0a6c8aeb386e9b7f1e2ccf505c26ed8e751b
parent 2f27589108fb30e925caf198249148bf3f7d4689
Author: Ember Sawady <ecs@d2evs.net>
Date:   Tue, 22 Nov 2022 00:10:49 +0000

cmd/hare: permit type inference for -D

Signed-off-by: Ember Sawady <ecs@d2evs.net>

Diffstat:
Mcmd/hare/subcmds.ha | 6+++---
Mdocs/hare.scd | 12++++++------
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/cmd/hare/subcmds.ha b/cmd/hare/subcmds.ha @@ -65,7 +65,7 @@ fn build(args: []str) void = { "compiles the Hare program at <path>", ('c', "build object instead of executable"), ('v', "print executed commands"), - ('D', "ident:type=value", "define a constant"), + ('D', "ident[:type]=value", "define a constant"), ('j', "jobs", "set parallelism for build"), ('l', "name", "link with a system library"), ('o', "path", "set output file name"), @@ -275,7 +275,7 @@ fn run(args: []str) void = { const help: []getopt::help = [ "compiles and runs the Hare program at <path>", ('v', "print executed commands"), - ('D', "ident:type=value", "define a constant"), + ('D', "ident[:type]=value", "define a constant"), ('j', "jobs", "set parallelism for build"), ('l', "name", "link with a system library"), ('T', "tags...", "set build tags"), @@ -385,7 +385,7 @@ fn test(args: []str) void = { const help: []getopt::help = [ "compiles and runs tests for Hare programs", ('v', "print executed commands"), - ('D', "ident:type=value", "define a constant"), + ('D', "ident[:type]=value", "define a constant"), ('j', "jobs", "set parallelism for build"), ('l', "name", "link with a system library"), ('o', "path", "set output file name"), diff --git a/docs/hare.scd b/docs/hare.scd @@ -7,7 +7,7 @@ hare - compiles, runs, and tests Hare programs # SYNOPSIS *hare* build [-cv]++ - [-D _ident:type=value_]++ + [-D _ident[:type]=value_]++ [-j _jobs_]++ [-l _name_]++ [-o _path_]++ @@ -18,14 +18,14 @@ hare - compiles, runs, and tests Hare programs *hare* deps [-Mm] [-T _tags_] [-X _tags_] _path_ *hare* run [-v]++ - [-D _ident:type=value_]++ + [-D _ident[:type]=value_]++ [-l _name_]++ [-j _jobs_]++ [-T _tags_] [-X _tags_]++ [_path_] [_args_...] *hare* test [-v]++ - [-D _ident:type=value_]++ + [-D _ident[:type]=value_]++ [-l _name_]++ [-j _jobs_]++ [-T _tags_] [-X _tags_]++ @@ -72,7 +72,7 @@ value, and optional context, separated by tabs. Enable verbose logging. Prints every command to stderr before executing it. -*-D* _ident:type=value_ +*-D* _ident[:type]=value_ Passed to *harec*(1) to define a constant in the type system. _ident_ is parsed as a Hare identifier (e.g. "foo::bar::baz"), _type_ as a Hare type (e.g. "str" or "struct { x: int, y: int }"), and _value_ as a Hare @@ -121,7 +121,7 @@ value, and optional context, separated by tabs. Enable verbose logging. Prints every command to stderr before executing it. -*-D* _ident:type=value_ +*-D* _ident[:type]=value_ Passed to *harec*(1) to define a constant in the type system. _ident_ is parsed as a Hare identifier (e.g. "foo::bar::baz"), _type_ as a Hare type (e.g. "str" or "struct { x: int, y: int }"), and _value_ as a Hare @@ -149,7 +149,7 @@ value, and optional context, separated by tabs. Enable verbose logging. Prints every command to stderr before executing it. -*-D* _ident:type=value_ +*-D* _ident[:type]=value_ Passed to *harec*(1) to define a constant in the type system. _ident_ is parsed as a Hare identifier (e.g. "foo::bar::baz"), _type_ as a Hare type (e.g. "str" or "struct { x: int, y: int }"), and _value_ as a Hare