Skip to content

Commit f27c2da

Browse files
committed
Add base64 dep, improve docs (man), add todo.txt
1 parent d6fda5d commit f27c2da

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ categories = ["command-line-utilities", "config", "encoding", "filesystem", "tem
1010
keywords = ["json"]
1111

1212
[dependencies]
13+
base64 = "0.22.1"
1314
serde_json = "1.0.141"
1415
thiserror = "2.0.12"
1516

docs/json2dir.1.scd

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ json2dir — convert JSON objects to directory trees
88

99
*json2dir* < _file.json_
1010

11-
# INPUT SCHEMA
11+
# CONVERSION SCHEME
1212

1313
- Objects represent directories.
1414
- Strings represent contents of files.
1515
- Arrays are used to represent symlinks and executable files.
1616
- Arrays of the form `["link", target]` represent symlinks, second element representing the target of the symlink.
1717
- Arrays of the form `["script", content]` represent executable files, second representing the content of the script.
1818

19-
# BUGS
19+
# CAVEATS
2020

2121
Regular JSON constraints apply. In particular, the input must be UTF-8. Currently, there's no way to represent files containing non-UTF-8 content.
2222

@@ -26,7 +26,7 @@ When using this utility to create files for other users, care must be taken in o
2626

2727
```
2828
printf '%s' '{
29-
"file": "Hello, world!",
29+
"greeting": "Hello, world!",
3030
"dir": {
3131
"subfile": "Content.\\n",
3232
"subdir": {}
@@ -36,7 +36,12 @@ printf '%s' '{
3636
}' | json2dir
3737
```
3838

39-
Here, four files will be added to the current directory: `file`, `dir`, `symlink`, and `script`.
39+
The following files will be created:
40+
41+
- `greeting`: a regular file containing the text `Hello, world!`.
42+
- `dir`: a directory with two entries in it (`subfile` and `subdir`).
43+
- `symlink`: a symbolic link pointing to `target path`,
44+
- `script`: an executable shell script that prints `Howdy!` when run.
4045

4146
# SEE ALSO
4247

docs/todo.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* Figure out if README.md can be used instead of a handwritten scdoc man page.
2+
* Install an extension for TOML.
3+
* Recursive type aliases in Rust when?

0 commit comments

Comments
 (0)