Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
fzdwx committed Jul 30, 2022
2 parents c5e3b84 + b4b28f6 commit 96448c6
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 64 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">get</h1>
<p align="center">A downloader</p>
<p align="center">This is a downloader.</p>

<p align="center">

Expand Down Expand Up @@ -53,27 +53,23 @@

----

This is a template CLI application, which can be used as a boilerplate for awesome CLI tools written in Go.
This template prints the date or time to the terminal.
This is a downloader CLI application, it can download some music or some other stuff.

## Installation

Run the following command in a terminal and you're ready to go!

**Windows**

```powershell
iwr instl.sh/fzdwx/get/windows | iex
```

**macOS**

```bash
curl -sSL instl.sh/fzdwx/get/macos | bash
```

**Linux**

```bash
curl -sSL instl.sh/fzdwx/get/linux | bash
```
7 changes: 3 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">cli-template</h1>
<p align="center">This cli template shows the date and time in the terminal</p>
<h1 align="center">get</h1>
<p align="center">This is a downloader.</p>

<p align="center">

Expand Down Expand Up @@ -49,8 +49,7 @@

----

This is a template CLI application, which can be used as a boilerplate for awesome CLI tools written in Go.
This template prints the date or time to the terminal.
This is a downloader CLI application, it can download some music or some other stuff.

## Installation

Expand Down
7 changes: 3 additions & 4 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# cli-template
# get

> This cli template shows the date and time in the terminal
> This is a downloader.
This is a template CLI application, which can be used as a boilerplate for awesome CLI tools written in Go.
This template prints the date or time to the terminal.
This is a downloader CLI application, it can download some music or some other stuff.

[Installation](installation.md)
[Docs](docs.md)
Expand Down
105 changes: 62 additions & 43 deletions docs/docs.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# cli-template
# get

## Usage
> This cli template shows the date and time in the terminal
> This is a downloader.
cli-template
get

## Description

```
This is a template CLI application, which can be used as a boilerplate for awesome CLI tools written in Go.
This template prints the date or time to the terminal.
This is a downloader CLI application, it can download some music or some other stuff.
```
## Examples

```bash
cli-template date
cli-template date --format 20060102
cli-template time
cli-template time --live
get mc 稻香
get date
get date --format 20060102
get time
get time --live
```

## Flags
Expand All @@ -30,40 +30,41 @@ cli-template time --live
## Commands
|Command|Usage|
|-------|-----|
|`cli-template completion`|Generate the autocompletion script for the specified shell|
|`cli-template date`|Prints the current date.|
|`cli-template help`|Help about any command|
|`cli-template time`|Prints the current time|
|`get completion`|Generate the autocompletion script for the specified shell|
|`get date`|Prints the current date.|
|`get help`|Help about any command|
|`get msc`|download music|
|`get time`|Prints the current time|
# ... completion
`cli-template completion`
`get completion`

## Usage
> Generate the autocompletion script for the specified shell
cli-template completion
get completion

## Description

```
Generate the autocompletion script for cli-template for the specified shell.
Generate the autocompletion script for get for the specified shell.
See each sub-command's help for details on how to use the generated script.
```

## Commands
|Command|Usage|
|-------|-----|
|`cli-template completion bash`|Generate the autocompletion script for bash|
|`cli-template completion fish`|Generate the autocompletion script for fish|
|`cli-template completion powershell`|Generate the autocompletion script for powershell|
|`cli-template completion zsh`|Generate the autocompletion script for zsh|
|`get completion bash`|Generate the autocompletion script for bash|
|`get completion fish`|Generate the autocompletion script for fish|
|`get completion powershell`|Generate the autocompletion script for powershell|
|`get completion zsh`|Generate the autocompletion script for zsh|
# ... completion bash
`cli-template completion bash`
`get completion bash`

## Usage
> Generate the autocompletion script for bash
cli-template completion bash
get completion bash

## Description

Expand All @@ -75,17 +76,17 @@ If it is not installed already, you can install it via your OS's package manager
To load completions in your current shell session:
source <(cli-template completion bash)
source <(get completion bash)
To load completions for every new session, execute once:
#### Linux:
cli-template completion bash > /etc/bash_completion.d/cli-template
get completion bash > /etc/bash_completion.d/get
#### macOS:
cli-template completion bash > /usr/local/etc/bash_completion.d/cli-template
get completion bash > $(brew --prefix)/etc/bash_completion.d/get
You will need to start a new shell for this setup to take effect.
Expand All @@ -96,12 +97,12 @@ You will need to start a new shell for this setup to take effect.
|----|-----|
|`--no-descriptions`|disable completion descriptions|
# ... completion fish
`cli-template completion fish`
`get completion fish`

## Usage
> Generate the autocompletion script for fish
cli-template completion fish
get completion fish

## Description

Expand All @@ -110,11 +111,11 @@ Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
cli-template completion fish | source
get completion fish | source
To load completions for every new session, execute once:
cli-template completion fish > ~/.config/fish/completions/cli-template.fish
get completion fish > ~/.config/fish/completions/get.fish
You will need to start a new shell for this setup to take effect.
Expand All @@ -125,12 +126,12 @@ You will need to start a new shell for this setup to take effect.
|----|-----|
|`--no-descriptions`|disable completion descriptions|
# ... completion powershell
`cli-template completion powershell`
`get completion powershell`

## Usage
> Generate the autocompletion script for powershell
cli-template completion powershell
get completion powershell

## Description

Expand All @@ -139,7 +140,7 @@ Generate the autocompletion script for powershell.
To load completions in your current shell session:
cli-template completion powershell | Out-String | Invoke-Expression
get completion powershell | Out-String | Invoke-Expression
To load completions for every new session, add the output of the above command
to your powershell profile.
Expand All @@ -151,12 +152,12 @@ to your powershell profile.
|----|-----|
|`--no-descriptions`|disable completion descriptions|
# ... completion zsh
`cli-template completion zsh`
`get completion zsh`

## Usage
> Generate the autocompletion script for zsh
cli-template completion zsh
get completion zsh

## Description

Expand All @@ -168,15 +169,19 @@ to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrc
To load completions in your current shell session:
source <(get completion zsh); compdef _get get
To load completions for every new session, execute once:
#### Linux:
cli-template completion zsh > "${fpath[1]}/_cli-template"
get completion zsh > "${fpath[1]}/_get"
#### macOS:
cli-template completion zsh > /usr/local/share/zsh/site-functions/_cli-template
get completion zsh > $(brew --prefix)/share/zsh/site-functions/_get
You will need to start a new shell for this setup to take effect.
Expand All @@ -187,38 +192,52 @@ You will need to start a new shell for this setup to take effect.
|----|-----|
|`--no-descriptions`|disable completion descriptions|
# ... date
`cli-template date`
`get date`

## Usage
> Prints the current date.
cli-template date
get date

## Flags
|Flag|Usage|
|----|-----|
|`-f, --format string`|specify a custom date format (default "02 Jan 06")|
# ... help
`cli-template help`
`get help`

## Usage
> Help about any command
cli-template help [command]
get help [command]

## Description

```
Help provides help for any command in the application.
Simply type cli-template help [path to command] for full details.
Simply type get help [path to command] for full details.
```
# ... msc
`get msc`

## Usage
> download music
get msc [song name]

## Description

```
download music. e.g:
get mc 不能说的秘密
```
# ... time
`cli-template time`
`get time`

## Usage
> Prints the current time
cli-template time
get time

## Description

Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>cli-template</title>
<title>get</title>
<link rel="icon" href="_assets/favicon.ico">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="description" content="Description">
Expand All @@ -18,7 +18,7 @@
<div id="app"></div>
<script>
window.$docsify = {
name: 'cli-template',
name: 'get',
repo: 'fzdwx/get',
executeScript: true,
loadSidebar: true,
Expand Down
10 changes: 5 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Quick Start - Install cli-template
# Quick Start - Install get

> [!TIP]
> cli-template is installable via [instl.sh](https://instl.sh).\
> get is installable via [instl.sh](https://instl.sh).\
> You just have to run the following command and you're ready to go!
<!-- tabs:start -->
Expand Down Expand Up @@ -35,10 +35,10 @@ curl -sSL instl.sh/fzdwx/get/macos | bash
### Compile from source with Golang

?> **NOTICE**
To compile cli-template from source, you have to have [Go](https://golang.org/) installed.
To compile get from source, you have to have [Go](https://golang.org/) installed.

Compiling cli-template from source has the benefit that the build command is the same on every platform.\
It is not recommended to install Go only for the installation of cli-template.
Compiling get from source has the benefit that the build command is the same on every platform.\
It is not recommended to install Go only for the installation of get.

```command
go install github.com/fzdwx/get@latest
Expand Down

0 comments on commit 96448c6

Please sign in to comment.