-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some are not passing, put in 'TODO' directory for now
- Loading branch information
1 parent
8693aa7
commit 02d2efb
Showing
22 changed files
with
629 additions
and
2 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
fixtures/TODO_examples_from_language_reference/arguments_and_possible_options__arg_.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"cmd": null, | ||
"main": { | ||
"args": [ | ||
{ | ||
"name": "vehicle_type1" | ||
}, | ||
{ | ||
"name": "vehicle_type3", | ||
"description": "The type of vehicle" | ||
}, | ||
{ | ||
"name": "vehicle_type4", | ||
"description": "The type of vehicle" | ||
}, | ||
{ | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "a" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "bool1", | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "T" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "F" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "bool2", | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "T" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "F" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
fixtures/TODO_examples_from_language_reference/arguments_and_possible_options__arg_.tabry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
arg vehicle_type1 | ||
arg vehicle_type3 "The type of vehicle" | ||
arg vehicle_type4 { | ||
desc "The type of vehicle" | ||
} | ||
arg { opts const a } | ||
arg (bool1 bool2) { | ||
opts const T | ||
opts const F | ||
} |
11 changes: 11 additions & 0 deletions
11
fixtures/TODO_examples_from_language_reference/multi_line_descriptions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"cmd": null, | ||
"main": { | ||
"subs": [ | ||
{ | ||
"name": "mycmd", | ||
"description": "My command:\n * It does stuff" | ||
} | ||
] | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
fixtures/TODO_examples_from_language_reference/multi_line_descriptions.tabry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sub mycmd { | ||
desc " | ||
My command: | ||
* It does stuff | ||
" | ||
} |
16 changes: 16 additions & 0 deletions
16
fixtures/examples_from_language_reference/argument_titles.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"cmd": null, | ||
"main": { | ||
"args": [ | ||
{ | ||
"name": "thing_to_search_for", | ||
"title": "thing to search for" | ||
}, | ||
{ | ||
"name": "files_to_load", | ||
"title": "file to load", | ||
"varargs": true | ||
} | ||
] | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
fixtures/examples_from_language_reference/argument_titles.tabry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
arg thing_to_search_for { title "thing to search for" } | ||
varargs files_to_load { title "file to load" } |
71 changes: 71 additions & 0 deletions
71
fixtures/examples_from_language_reference/flags__flag__flagarg__reqd_flagarg_.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"cmd": null, | ||
"main": { | ||
"flags": [ | ||
{ | ||
"name": "dry-run", | ||
"aliases": [ | ||
"d" | ||
] | ||
}, | ||
{ | ||
"name": "dry-run2", | ||
"aliases": [ | ||
"r" | ||
], | ||
"description": "Don't act, only show what would be done" | ||
}, | ||
{ | ||
"name": "f", | ||
"aliases": [ | ||
"format" | ||
], | ||
"arg": true, | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "json" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "yml" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "env", | ||
"aliases": [ | ||
"e" | ||
], | ||
"description": "The environment (this must be given)", | ||
"arg": true, | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "prod" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "beta" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "dev" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "interactive", | ||
"aliases": [ | ||
"i" | ||
] | ||
}, | ||
{ | ||
"name": "force", | ||
"aliases": [ | ||
"f" | ||
] | ||
} | ||
] | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
fixtures/examples_from_language_reference/flags__flag__flagarg__reqd_flagarg_.tabry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
flag dry-run,d | ||
flag dry-run2,r "Don't act, only show what would be done" | ||
flagarg f,format { opts const (json yml) } | ||
flagarg env,e "The environment (this must be given)" { | ||
opts const (prod beta dev) | ||
} | ||
flag (interactive,i force,f) |
31 changes: 31 additions & 0 deletions
31
fixtures/examples_from_language_reference/getting_started.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"cmd": "control-vehicle", | ||
"main": { | ||
"args": [ | ||
{ | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "car" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "bike" | ||
} | ||
] | ||
}, | ||
{ | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "go" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "stop" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
fixtures/examples_from_language_reference/getting_started.tabry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cmd control-vehicle | ||
|
||
# The vehicle argument | ||
# Note: comments must be on a line of their own | ||
arg { | ||
opts const car | ||
opts const bike | ||
} | ||
|
||
arg { | ||
opts const go | ||
opts const stop | ||
} |
129 changes: 129 additions & 0 deletions
129
fixtures/examples_from_language_reference/includes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"cmd": "mydeploy", | ||
"main": { | ||
"args": [ | ||
{ | ||
"include": "project-and-environment" | ||
} | ||
], | ||
"flags": [ | ||
{ | ||
"include": "project-and-environment" | ||
} | ||
], | ||
"subs": [ | ||
{ | ||
"include": "project-and-environment" | ||
}, | ||
{ | ||
"name": "status", | ||
"args": [ | ||
{ | ||
"include": "project-and-environment" | ||
}, | ||
{ | ||
"include": "verbose" | ||
} | ||
], | ||
"flags": [ | ||
{ | ||
"include": "project-and-environment" | ||
}, | ||
{ | ||
"include": "verbose" | ||
} | ||
], | ||
"subs": [ | ||
{ | ||
"include": "project-and-environment" | ||
}, | ||
{ | ||
"include": "verbose" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "list", | ||
"args": [ | ||
{ | ||
"include": "verbose" | ||
} | ||
], | ||
"flags": [ | ||
{ | ||
"include": "verbose" | ||
}, | ||
{ | ||
"name": "env", | ||
"options": [ | ||
{ | ||
"type": "include", | ||
"value": "environment" | ||
} | ||
], | ||
"arg": true | ||
} | ||
], | ||
"subs": [ | ||
{ | ||
"include": "verbose" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"option_includes": { | ||
"environment": [ | ||
{ | ||
"type": "const", | ||
"value": "prod" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "beta" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "dev" | ||
} | ||
] | ||
}, | ||
"arg_includes": { | ||
"verbose": { | ||
"flags": [ | ||
{ | ||
"name": "verbose", | ||
"description": "Show more info" | ||
} | ||
] | ||
}, | ||
"project-and-environment": { | ||
"args": [ | ||
{ | ||
"name": "project", | ||
"description": "The project", | ||
"options": [ | ||
{ | ||
"type": "const", | ||
"value": "project1" | ||
}, | ||
{ | ||
"type": "const", | ||
"value": "project2" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "environment", | ||
"options": [ | ||
{ | ||
"type": "include", | ||
"value": "environment" | ||
} | ||
], | ||
"description": "The environment" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
cmd mydeploy | ||
|
||
# Default command acts on project-and-environment | ||
include @project-and-environment | ||
|
||
# status command acts and project-and-environment as well | ||
sub status @project-and-environment @verbose | ||
|
||
# list command takes no position args, but takes an optional "env" flag | ||
sub list @verbose { | ||
flagarg env @environment | ||
} | ||
|
||
defopts @environment { | ||
opts const (prod beta dev) | ||
} | ||
|
||
defargs @verbose { | ||
flag verbose "Show more info" | ||
} | ||
|
||
defargs @project-and-environment { | ||
arg project "The project" { opts const (project1 project2) } | ||
arg environment "The environment" @environment | ||
} |
Oops, something went wrong.