diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c47c3f..b895b98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 0.5.0 (2020-07-04) + +Feature: ([#5](https://github.com/progrhyme/binq/pull/5)) + +- (CLI) Add `register` subcommand to add Item into Index +- (CLI) Add `deregister` subcommand to remove Item from Index +- (CLI) Add `modify` subcommand to edit properties of Item in Index +- (install, client) Verify checksum of downloaded item when it is provided by Item JSON + +Change: ([#5](https://github.com/progrhyme/binq/pull/5)) + +- (schema/item) Rename struct ItemChecksums -> ItemChecksum + ## 0.4.0 (2020-07-03) Feature: ([#4](https://github.com/progrhyme/binq/pull/4)) diff --git a/README.md b/README.md index 69d6570..de84a6f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Typical commands to achieve this are following: ```sh bin=/usr/local/bin # Change to your favorite path -version=0.4.0 # Make sure this is the latest +version=0.5.0 # Make sure this is the latest os=darwin # or "linux" is supported tmpfile=$(mktemp) curl -Lo $tmpfile "https://github.com/progrhyme/binq/releases/download/v${version}/binq_${version}_${os}_amd64.zip" @@ -58,9 +58,12 @@ binq [install] [-t|--target] SOURCE \ [GENERAL_OPTIONS] # Other Commands -binq new # Create Item JSON for Index Server -binq revise # Add/Edit/Delete a version in Item JSON -binq version # Show binq version +binq new # Create Item JSON for Index Server +binq revise # Add/Edit/Delete a version in Item JSON +binq register # Register item JSON into Local Index Dataset +binq modify # Modify item properties on Local Index +binq deregister # Deregister item from Local Index Dataset +binq version # Show binq version # Show help binq [COMMAND] -h|--help @@ -131,13 +134,33 @@ binq revise ITEM_JSON_FILE VERSION \ binq revise ITEM_JSON_FILE VERSION --delete [-y|--yes] [GENERAL_OPTIONS] ``` +## Manipulate Local Index Dataset + +You can interact with Index Dataset using `binq`, but currently CLI only supports Local Dataset in +filesystem. + +Commands Syntax: + +```sh +# Register or Update Item content on Local Index Dataset +binq register pato/to/root[/index.json] path/to/item.json \ + [-n|--name NAME] [-p|--path PATH] [-y|--yes] [GENERAL_OPTIONS] + +# Modify Item properties in Local Index Dataset +binq modify pato/to/root[/index.json] NAME \ + [-n|--name NEW_NAME] [-p|--path PATH] [-y|--yes] [GENERAL_OPTIONS] + +# Deregister Item from Local Index Dataset +binq deregister pato/to/root[/index.json] NAME [-y|--yes] [GENERAL_OPTIONS] +``` + # Binq Index Server `binq` refers to an index server to fetch meta data of an item when its identifier is specified instead of full URL. We call it **Binq Index Server**. -It contains the database of downloadable items with their URLs for `binq`. +It contains the dataset of downloadable items with their URLs for `binq`. When `binq` send a request to the server, it responds a JSON data which contains information about the item. diff --git a/binq.go b/binq.go index 11b1977..b090100 100644 --- a/binq.go +++ b/binq.go @@ -1,6 +1,6 @@ package binq const ( - Version = "0.4.0" + Version = "0.5.0" EnvKeyServer = "BINQ_SERVER" ) diff --git a/internal/cli/deregister.go b/internal/cli/deregister.go index d48b5d7..96ecca8 100644 --- a/internal/cli/deregister.go +++ b/internal/cli/deregister.go @@ -27,7 +27,7 @@ func newDeregisterCmd(common *commonCmd) (self *deregisterCmd) { func (cmd *deregisterCmd) usage() { const help = `Summary: - Deregister an Item from {{.prog}} Index. + Deregister an Item from Local {{.prog}} Index Dataset. Usage: {{.prog}} {{.name}} pato/to/root[/index.json] NAME [-y|--yes] [GENERAL_OPTIONS] diff --git a/internal/cli/install.go b/internal/cli/install.go index ecd5c69..f4f8478 100644 --- a/internal/cli/install.go +++ b/internal/cli/install.go @@ -86,6 +86,9 @@ Available Commands: install (Default) # Install binary or archive item new # Create item JSON for Index Server revise # Add/Edit/Delete a version in item JSON + register # Register item JSON into Local Index Dataset + modify # Modify item properties on Local Index + deregister # Deregister item from Local Index Dataset version # Show {{.prog}} version Run "{{.prog}} COMMAND -h|--help" to see usage of each command. diff --git a/internal/cli/modify.go b/internal/cli/modify.go index 0432fe2..b4091e3 100644 --- a/internal/cli/modify.go +++ b/internal/cli/modify.go @@ -42,7 +42,7 @@ func newModifyCmd(common *commonCmd) (self *modifyCmd) { func (cmd *modifyCmd) usage() { const help = `Summary: - Modify the indice properties of an Item in {{.prog}} Index. + Modify the indice properties of an Item in Local {{.prog}} Index Dataset. Usage: {{.prog}} {{.name}} pato/to/root[/index.json] NAME \ diff --git a/internal/cli/register.go b/internal/cli/register.go index 9cbb941..fbe5dc4 100644 --- a/internal/cli/register.go +++ b/internal/cli/register.go @@ -48,7 +48,7 @@ func newRegisterCmd(common *commonCmd) (self *registerCmd) { func (cmd *registerCmd) usage() { const help = `Summary: - Register or Update Item content on {{.prog}} Index. + Register or Update Item content on Local {{.prog}} Index Dataset. Usage: {{.prog}} {{.name}} pato/to/root[/index.json] path/to/item.json \