Skip to content

Commit

Permalink
Add subcommand aliases (#31)
Browse files Browse the repository at this point in the history
Add the following aliases for subcommands:

- `info` for `details`
- `d` for `download`
- `ls` for `list`
  • Loading branch information
smbl64 authored Oct 26, 2023
1 parent e55927e commit 762b5d7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "humble-cli"
authors = ["Mohammad Banisaeid <[email protected]>"]
version = "0.12.0"
version = "0.13.0"
license = "MIT"
description = "The missing CLI for downloading your Humble Bundle purchases"
documentation = "https://github.com/smbl64/humble-cli"
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ The missing CLI for downloading your Humble Bundle purchases!
- Search through all your purchases for a specific product

## Install
Option 1: Download the binaries in the [Releases][releases] page. Windows, macOS and Linux are supported.
**Option 1:** Download the binaries in the [Releases][releases] page. Windows, macOS and Linux are supported.

Option 2: Install it via `cargo`:
**Option 2:** Install it via `cargo`:

```sh
cargo install humble-cli
Expand All @@ -36,9 +36,7 @@ Use `humble-cli auth "<YOUR SESSION KEY>"` to store the authentication key local
After that you will have access to the following sub-commands:

```
$ humble-cli --help
humble-cli 0.12.0
$ humble-cli 0.13.0
The missing Humble Bundle CLI
USAGE:
Expand All @@ -50,10 +48,10 @@ OPTIONS:
SUBCOMMANDS:
auth Set the authentication session key
details Print details of a certain bundle
download Selectively download items from a bundle
details Print details of a certain bundle [aliases: info]
download Selectively download items from a bundle [aliases: d]
help Print this message or the help of the given subcommand(s)
list List all your purchased bundles
list List all your purchased bundles [aliases: ls]
list-choices List your current Humble Choices
search Search through all bundle products for keywords
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fn parse_match_mode(input: &str) -> Result<MatchMode, anyhow::Error> {
fn run() -> Result<(), anyhow::Error> {
let list_subcommand = Command::new("list")
.about("List all your purchased bundles")
.visible_alias("ls")
.arg(
Arg::new("id-only")
.long("id-only")
Expand Down Expand Up @@ -67,6 +68,7 @@ fn run() -> Result<(), anyhow::Error> {

let details_subcommand = Command::new("details")
.about("Print details of a certain bundle")
.visible_alias("info")
.arg(
Arg::new("BUNDLE-KEY")
.required(true)
Expand Down Expand Up @@ -99,6 +101,7 @@ fn run() -> Result<(), anyhow::Error> {

let download_subcommand = Command::new("download")
.about("Selectively download items from a bundle")
.visible_alias("d")
.arg(
Arg::new("BUNDLE-KEY")
.required(true)
Expand Down

0 comments on commit 762b5d7

Please sign in to comment.