-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
005ed59
commit f881f80
Showing
5 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Hello project | ||
|
||
This is an example project on how you can structure your CLI called `hello` | ||
with a subcommand `world`. | ||
|
||
To run it from this repo's root, make sure `sub` is installed and run: | ||
|
||
```sh | ||
./examples/hello/bin/hello | ||
``` | ||
|
||
And to actually print "Hello, world!" run: | ||
|
||
```sh | ||
./examples/hello/bin/hello world | ||
``` | ||
|
||
If you want to use this project as a template, simply replace the two | ||
occurrences of `hello` with your CLI name (for example `hat`): | ||
|
||
1. The file `bin/hello` should be renamed to `bin/hat`. | ||
2. The argument `--name hello` in `bin/hello` (now `bin/hat`) should be changed | ||
to `--name hat`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#/usr/bin/env bash | ||
|
||
set -e | ||
|
||
sub --name hello --executable "${BASH_SOURCE[0]}" --relative ".." -- "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Summary: CLI implementation of Hello World | ||
# | ||
# A "Hello, World!" program is generally a simple computer program which outputs | ||
# (or displays) to the screen (often the console) a message similar to "Hello, | ||
# World!" while ignoring any user input. A small piece of code in most | ||
# general-purpose programming languages, this program is used to illustrate a | ||
# language's basic syntax. A "Hello, World!" program is often the first written | ||
# by a student of a new programming language,[1] but such a program can also be | ||
# used as a sanity check to ensure that the computer software intended to compile | ||
# or run source code is correctly installed, and that its operator understands | ||
# how to use it. | ||
# | ||
# https://en.wikipedia.org/wiki/%22Hello,_World!%22_program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
# Summary: Say hello | ||
# Usage: {cmd} | ||
|
||
set -e | ||
|
||
echo "Hello, world!" |