Skip to content

Commit

Permalink
Fix --flatten flag parsing
Browse files Browse the repository at this point in the history
Lines starting with `--` are considered options in docopt, and
`--flatten` was present at the start of a description line as
well as listed in the options sectioon; this caused docopt to
record --flatten twice, giving the cryptic message:

`--flatten is not a unique prefix: --flatten, --flatten?`

sigh.

docopt does have some serious downsides.
  • Loading branch information
marques-work committed Aug 31, 2017
1 parent 5cac950 commit f1a8b05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ Options:
-d DICTPATH --dictionaries=DICTPATH Specify DICTPATH
-f --flatten Flattens entity hierarchies into a flat array; entities are
outputted in reverse order of dependency, and linked by "$id"
-s --split-output Outputs entities into files, separated by declared type; implies
--flatten
-s --split-output Aggregates entities by type into separate files; DESTFILE
serves as the filename template, meaning each file has the
entity type appended to its basename (i.e. before the ".json"
extension, as in "entities-myType.json"). Implies --flatten.
```

### Input File Format
Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ Options:
-d DICTPATH --dictionaries=DICTPATH Specify DICTPATH
-f --flatten Flattens entity hierarchies into a flat array; entities are
outputted in reverse order of dependency, and linked by "$id"
-s --split-output Outputs entities into files, separated by declared type; implies
--flatten
-s --split-output Aggregates entities by type into separate files; DESTFILE
serves as the filename template, meaning each file has the
entity type appended to its basename (i.e. before the ".json"
extension, as in "entities-myType.json"). Implies --flatten.
`
)
Expand Down

0 comments on commit f1a8b05

Please sign in to comment.