Skip to content

Commit d6b8beb

Browse files
authored
Fix broken example use-cases in docs for kosli-fingerprint (#577)
Fix some example documentation use-cases for the kosli-fingerprint command which attempts to mention a file glob that includes an asterisk and ^ bracketing, neither of which work in the md formatting.
1 parent 8259cab commit d6b8beb

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

cmd/kosli/createEnvironment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ kosli create environment yourEnvironmentName
4545
--api-token yourAPIToken \
4646
--org yourOrgName
4747
48-
48+
# create a Kosli logical environment:
4949
kosli create environment yourLogicalEnvironmentName
5050
--type logical \
5151
--included-environments realEnv1,realEnv2,realEnv3

cmd/kosli/detachPolicy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const detachPolicyShortDesc = `Detach a policy from one or more Kosli environmen
1919
const detachPolicyLongDesc = `If the environment has no more policies attached to it, then its snapshots' status will become "unknown".`
2020

2121
const detachPolicyExample = `
22-
# detach policy from multiple environment:
22+
# detach policy from multiple environments:
2323
kosli detach-policy yourPolicyName \
2424
--environment yourFirstEnvironmentName \
2525
--environment yourSecondEnvironmentName \

cmd/kosli/docs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func KosliGenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(st
208208
// Some titles have a trailing colon, some don't
209209
title := strings.Trim(exampleLines[0], ":")
210210
if len(title) > 0 {
211-
buf.WriteString(fmt.Sprintf("**%s**\n\n", strings.TrimSpace(title[1:])))
211+
buf.WriteString(fmt.Sprintf("##### %s\n\n", strings.TrimSpace(title[1:])))
212212
buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", strings.Join(exampleLines[1:], "\n")))
213213
}
214214
}

cmd/kosli/fingerprint.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ kosli fingerprint --artifact-type file file.txt
4949
# fingerprint a dir
5050
kosli fingerprint --artifact-type dir mydir
5151
52-
# fingerprint a dir while excluding paths ^mydir/logs^ and ^mydir/*exe^
52+
# fingerprint a dir while excluding paths ` + "`" + `mydir/logs` + "`" + ` and ` + "`" + `mydir/*.exe` + "`" + `
5353
kosli fingerprint --artifact-type dir --exclude logs --exclude *.exe mydir
5454
55-
# fingerprint a dir while excluding all ^.pyc^ files
55+
# fingerprint a dir while excluding all ` + "`" + `.pyc` + "`" + ` files
5656
kosli fingerprint --artifact-type dir --exclude **/*.pyc mydir
5757
58-
# fingerprint a dir while excluding paths in .kosli_ignore file
58+
# fingerprint a dir while excluding paths in ` + "`" + `.kosli_ignore` + "`" + ` file
5959
echo bar/file.txt > mydir/.kosli_ignore
6060
kosli fingerprint --artifact-type dir mydir
6161
@@ -66,7 +66,9 @@ kosli fingerprint --artifact-type docker nginx:latest
6666
kosli fingerprint --artifact-type oci nginx:latest
6767
6868
# fingerprint a private image from a remote registry
69-
kosli fingerprint --artifact-type oci private:latest --registry-username YourUsername --registry-password YourPassword
69+
kosli fingerprint --artifact-type oci private:latest \\
70+
--registry-username YourUsername \\
71+
--registry-password YourPassword
7072
`
7173

7274
type fingerprintOptions struct {

cmd/kosli/testdata/output/docs/snyk.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ binding the attestation to the right artifact.
6464

6565
These examples all assume that the flags `--api-token`, `--org`, `--host`, (and `--flow`, `--trail` when required), are [set/provided](https://docs.kosli.com/getting_started/install/#assigning-flags-via-environment-variables).
6666

67-
**report a snyk attestation about a pre-built docker artifact (kosli calculates the fingerprint)**
67+
##### report a snyk attestation about a pre-built docker artifact (kosli calculates the fingerprint)
6868

6969
```shell
7070
kosli attest snyk yourDockerImageName
@@ -74,7 +74,7 @@ kosli attest snyk yourDockerImageName
7474

7575
```
7676

77-
**report a snyk attestation about a pre-built docker artifact (you provide the fingerprint)**
77+
##### report a snyk attestation about a pre-built docker artifact (you provide the fingerprint)
7878

7979
```shell
8080
kosli attest snyk
@@ -84,7 +84,7 @@ kosli attest snyk
8484

8585
```
8686

87-
**report a snyk attestation about a trail**
87+
##### report a snyk attestation about a trail
8888

8989
```shell
9090
kosli attest snyk
@@ -93,7 +93,7 @@ kosli attest snyk
9393

9494
```
9595

96-
**report a snyk attestation about an artifact which has not been reported yet in a trail**
96+
##### report a snyk attestation about an artifact which has not been reported yet in a trail
9797

9898
```shell
9999
kosli attest snyk
@@ -103,7 +103,7 @@ kosli attest snyk
103103

104104
```
105105

106-
**report a snyk attestation about a trail with an attachment**
106+
##### report a snyk attestation about a trail with an attachment
107107

108108
```shell
109109
kosli attest snyk
@@ -113,7 +113,7 @@ kosli attest snyk
113113

114114
```
115115

116-
**report a snyk attestation about a trail without uploading the snyk results file**
116+
##### report a snyk attestation about a trail without uploading the snyk results file
117117

118118
```shell
119119
kosli attest snyk

0 commit comments

Comments
 (0)