Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove comment left in code #32

Merged
merged 6 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

<!-- markdownlint-disable no-trailing-punctuation -->

## next

TODO: Date

- Features:
- `-h` made alternate option to display help. (contributed by @scribe in #31 and #32)
> This is implemented by switching to `structopt` for argument parsing.
> Additionally, `--in` and `--out` now show valid choices with the `-h`/`--help` command.

## 0.0.2

2021-08-01
Expand Down
1 change: 1 addition & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
identification within third-party archives.

Copyright 2020-2021 Tamme Schichler <tamme@schichler.dev>
Copyright 2020-2021 Eric Bergstrom <scribegithub@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2020-2021 Tamme Schichler <tamme@schichler.dev>
Copyright (c) 2020-2021 Eric Bergstrom <scribegithub@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 39 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,45 @@ reserde --help
```

```txt
Usage: reserde.exe [--if <if>] [--of <of>] -i <in> -o <out> [-p] [-s <stringify...>] [--enum-bools]

Transcode a self-describing format into a different format. Currently supports Bencode, Bincode (--out only), CBOR, JSON (--pretty), TAML (--in only), XML, x-www-form-urlencoded (as urlencoded) and YAML. All names are lowercase.

Options:
--if where to read input from. Defaults to stdin
--of where to write output to. Defaults to stdout
-i, --in what to read
-o, --out what to write
-p, --pretty pretty-print (where supported)
-s, --stringify stringify bytes and non-string value keys into strings where
possible, possible values are: utf8. (Tries encodings in the
order specified.) [try with: --in bencode]
--enum-bools case-insensitively convert unit variants with name `true` or
`false` into booleans.
--help display usage information
reserde 0.0.2
Transcode a self-describing format into a different format.

Currently supports Bencode, Bincode (--out only), CBOR, JSON (--pretty), TAML (--in only), XML, x-www-form-urlencoded
(as urlencoded) and YAML. All names are lowercase.

USAGE:
reserde [FLAGS] [OPTIONS] --in <in-format> --out <out-format>

FLAGS:
--enum-bools
case-insensitively convert unit variants with name `true` or `false` into booleans

-h, --help
Prints help information

-p
pretty-print (where supported)

-V, --version
Prints version information


OPTIONS:
--if <in-file>
where to read input from. Defaults to stdin

-i, --in <in-format>
what to read [possible values: bencode, cbor, json, taml, urlencoded, xml, yaml]

--of <out-file>
where to write output to. Defaults to stdout

-o, --out <out-format>
what to write [possible values: bencode, bincode, cbor, json, urlencoded, xml, yaml]

-s <stringify>...
stringify bytes and non-string value keys into strings where possible, possible values are: utf8. (Tries
encodings in the order specified.) [try with: --in bencode]
```

## Examples
Expand Down
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ struct Args {
/// where to write output to. Defaults to stdout
out_file: Option<PathBuf>,

//TODO: List In variant.
#[structopt(short = "i", long = "in", possible_values = In::VARIANTS)]
/// what to read
in_format: In,

//TODO: List Out variant.
#[structopt(short = "o", long = "out", possible_values = Out::VARIANTS)]
/// what to write
out_format: Out,
Expand Down