Skip to content

Commit

Permalink
add man page - shed-contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
siakhooi committed Apr 19, 2024
1 parent 017401b commit 66ae751
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 132 deletions.
2 changes: 1 addition & 1 deletion docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| `shed-helm` [helm arguments] | `h` | bin || [📚 Doc](shed-helm.md) |
| `shed-istioctl` [istioctl arguments] | `i` | bin || [📚 Doc](shed-istioctl.md) |
| `shed-use` shedCode | | function || [📚 Doc](shed-use.md) |
| `shed-contexts` | `sc` | bin | ||
| `shed-contexts` | `sc` | bin | ||
| `shed-kubeconfig-use` kubeconfig-number | `c0`, `c1`, `c2`, `c3`, `c4` | function || [📚 Doc](shed-kubeconfig-use.md) |
| `shed` | | bin || [📚 Doc](shed.md) |
| `shed-kubectl-resources` | | bin || [📚 Doc](shed-kubectl-resources.md) |
Expand Down
4 changes: 2 additions & 2 deletions release.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

RELEASE_VERSION=1.19.0
RELEASE_TITLE='add man page - shed-kubectl-logs-previous'
RELEASE_VERSION=1.20.0
RELEASE_TITLE='add man page - shed-contexts'

REGISTRY_USERNAME_DOCKER=siakhooi
2 changes: 1 addition & 1 deletion src/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: siakhooi-shed
Version: 1.19.0
Version: 1.20.0
Maintainer: Siak Hooi <siakhooi@gmail.com>
Depends: bash, coreutils, findutils, grep, vim, man-db, sed, siakhooi-devutils-echo-colors (>= 1.0.0), git, siakhooi-textutils (>= 1.7.0), bash-completion, jq
Architecture: amd64
Expand Down
2 changes: 1 addition & 1 deletion src/lib/shed-init
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

export SHED_VERSION=1.19.0
export SHED_VERSION=1.20.0
export SHED_CONFIG_HOME="${SHED_CONFIG_HOME:-$HOME/.shed}"
export SHED_CONFIG_FILE=${SHED_CONFIG_HOME}/config.yaml
export SHED_CONFIG_DIRECTORY_RESOURCES=$SHED_CONFIG_HOME/kubectl-resources
Expand Down
51 changes: 51 additions & 0 deletions src/md/shed-contexts.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
% SHED-CONTEXTS(1) Siak Hooi DevUtils 1.1.0 | Shed Commands
% Siak Hooi
% April 2024

# NAME
shed-contexts - list all contexts of current shed.\
sc - alias to shed-contexts

# SYNOPSIS
**shed-context**\
**sc**

# DESCRIPTION
List all contexts of current shed.

# EXAMPLES
**shed-contexts**\
\ \ \ \ Context \ Name \ \ \ \ Kube Context \ Namespace\
\ \ \ \ c0 \ \ \ \ \ \ dev-app \ kube-dev-1 \ \ \ ns-application\
\ \ \ \ c1 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ kube-dev-1 \ \ \ ns-database

# FILES
~/.shed/config.yaml
: shed config file

# ENVIRONMENT VARIABLES
SHED_CONFIG_FILE
: shed config file, default to $SHED_CONFIG_HOME/config.yaml

SHED_CODE
: the current Shed.

# EXIT CODE
**1**
: Environment variable SHED_CONFIG_FILE is not set.

**2**
: File stated in SHED_CONFIG_FILE does not exist.

**3**
: Environment variable SHED_CODE is not set, use **shed-use** to set a shedCode.


# LICENSE
MIT

# BUGS
Report bugs at https://github.com/siakhooi/shed/issues.

# SEE ALSO
shed-use(1), shed-values(1), shed-config(1), shed-config.yaml(5)
2 changes: 1 addition & 1 deletion src/md/shed-values.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ MIT
Report bugs at https://github.com/siakhooi/shed/issues.

# SEE ALSO
shed-use(1), shed-value(1), shed-config(1), shed-config.yaml(5), shed-value-key-list(1)
shed-use(1), shed-value(1), shed-config(1), shed-config.yaml(5), shed-value-key-list(1), shed-contexts(1)
50 changes: 50 additions & 0 deletions tests/bats-test-scripts/man/man-1-shed-contexts.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SHED-CONTEXTS(1) Shed Commands SHED-CONTEXTS(1)

NAME
shed-contexts - list all contexts of current shed.
sc - alias to shed-contexts

SYNOPSIS
shed-context
sc

DESCRIPTION
List all contexts of current shed.

EXAMPLES
shed-contexts
Context Name Kube Context Namespace
c0 dev-app kube-dev-1 ns-application
c1 kube-dev-1 ns-database

FILES
~/.shed/config.yaml
shed config file

ENVIRONMENT VARIABLES
SHED_CONFIG_FILE
shed config file, default to $SHED_CONFIG_HOME/config.yaml

SHED_CODE
the current Shed.

EXIT CODE
1 Environment variable SHED_CONFIG_FILE is not set.

2 File stated in SHED_CONFIG_FILE does not exist.

3 Environment variable SHED_CODE is not set, use shed-use to set a shedCode.

LICENSE
MIT

BUGS
Report bugs at https://github.com/siakhooi/shed/issues.

SEE ALSO
shed-use(1), shed-values(1), shed-config(1), shed-config.yaml(5)

AUTHORS
Siak Hooi.

Siak Hooi DevUtils 1.1.0 April 2024 SHED-CONTEXTS(1)
2 changes: 1 addition & 1 deletion tests/bats-test-scripts/man/man-1-shed-values.expected
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BUGS
Report bugs at https://github.com/siakhooi/shed/issues.

SEE ALSO
shed-use(1), shed-value(1), shed-config(1), shed-config.yaml(5), shed-value-key-list(1)
shed-use(1), shed-value(1), shed-config(1), shed-config.yaml(5), shed-value-key-list(1), shed-contexts(1)

AUTHORS
Siak Hooi.
Expand Down
125 changes: 0 additions & 125 deletions tests/bats-test-scripts/man/man-1-shed.expected.new

This file was deleted.

3 changes: 3 additions & 0 deletions tests/bats-test-scripts/man/man.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ run-man-test(){
@test "man shed-aliases" {
run-man-test 1 shed-aliases
}
@test "man shed-contexts" {
run-man-test 1 shed-contexts
}
@test "man shed-config-edit" {
run-man-test 1 shed-config-edit
}
Expand Down

0 comments on commit 66ae751

Please sign in to comment.