Skip to content

Commit

Permalink
fix: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mschrage committed Apr 29, 2021
1 parent e3049da commit 96b2a8e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
9 changes: 9 additions & 0 deletions fig.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def argumentsDictionary(args):
arg = args[argName]
choices = arg.choices if arg.choices == None or isinstance(arg.choices, list) else list(arg.choices)
description = stripHTML(arg.documentation)
variadic = arg.nargs != None and arg.nargs == "+"
# print(arg.cli_name, arg.nargs, arg.required)
# js = { "name": arg.cli_name, "type": arg.cli_type_name, "nargs": arg.nargs, "required": arg.required, "documentation": arg.documentation, "suggestions": arg.choices}
raw = {"name": arg.cli_name }

Expand All @@ -40,14 +42,21 @@ def argumentsDictionary(args):
if arg.positional_arg:
if choices != None and len(choices) > 0:
raw["suggestions"] = choices
# raw["isOptional"] = not arg.required
if variadic:
raw["variadic"] = variadic

positional.append(raw)
elif arg.cli_type_name == "boolean":
flags.append(raw)
else:
raw["args"] = { "name": arg.cli_type_name }
if choices != None and len(choices) > 0:
raw["args"]["suggestions"] = choices
# raw["isOptional"] = not arg.required

if variadic:
raw["args"]["variadic"] = variadic
flags.append(raw)

return (flags, positional)
Expand Down
13 changes: 11 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ This is an `aws` plugin that will generate completion specs directly from the in

1. Make sure to install the AWS CLI

2. Run `install.sh`
2. Run `setup.sh`

3. Update variables in `fig.py`
- `exportDirectory` should be the project directory
- `exportTypescript` bool whether to export Typescript or Javascript
- `exportTypescript` bool whether to export Typescript or Javascript


Output will be in `exports` folder, once you run any `aws` command.

### Todo

[] nargs to variadic flag
[] service descriptions
[]

0 comments on commit 96b2a8e

Please sign in to comment.