Skip to content

Add dir2json, improve the command line experience, change README, etc. #4

@alurm

Description

@alurm

We want to add dir2json (somehow), so it's possible to pack directories into JSON.

Currently, we have only json2dir. It accepts no arguments, very simple.

Besides dir2json, I have a couple of features in mind:

  • List JSON archives in various ways:
    • Something like ls is currently possible by passing the archive to jq keys[] -r
    • Something like find . is currently possible by passing the archive to jq 'walk(if type != "object" then null end) | paths | join("/")' --raw-output (or --raw-output0) (thanks @magistau)

I'm thinking of the following CLI:

# Usage.
jsondir

# Basic functionality.
jsondir to json
jsondir to dir

# Listing.
jsondir list
jsondir find

# If we decide to support YAML.
jsondir to yaml
jsondir to dir from yaml
jsondir list yaml
jsondir find yaml

Other options

dir2json
json2dir

Unclear how to add subcommands


jsondir json create
jsondir dir create
jsondir json list <path>
jsondir json paths <path>

Too verbose?


json2dir
json2dir unpack # (Explicit.)
json2dir pack

It's confusing how json2dir can actually create JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions