Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 9d1f8f1

Browse files
committed
Added go1.16 support, updated version and copyright year, adding M1 compile support
1 parent b2bcc85 commit 9d1f8f1

File tree

22 files changed

+609
-425
lines changed

22 files changed

+609
-425
lines changed

INSTALL.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11

2-
# Installation
2+
Installation
3+
============
34

45
*cligenerate* and *pkgassets* are a command line programs run from a
56
shell like Bash. You can find compiled version in the
67
[releases](https://github.com/caltechlibrary/cli/releases/latest).
78

8-
## Compiled version
9+
Compiled version
10+
----------------
911

1012
This is generalized instructions for a release.
1113

12-
Compiled versions are available for Mac OS X (amd64 processor,
13-
macosx-amd64), Linux (amd64 process, linux-amd64),
14+
Compiled versions are available for Mac OS X (amd64 and M1 processor,
15+
macos-amd64 and macos-arm64), Linux (amd64 process, linux-amd64),
1416
Windows (amd64 processor, windows-amd64) and Rapsberry Pi (arm7
1517
processor, raspbian-arm7)
1618

@@ -27,20 +29,22 @@ click latest release
2729
| Platform | Zip Filename |
2830
|-------------|--------------------------------------------|
2931
| Windows | cli-VERSION_NUMBER-windows-amd64.zip |
30-
| Mac OS X | cli-VERSION_NUMBER-macosx-amd64.zip |
32+
| Mac OS X | cli-VERSION_NUMBER-macos-amd64.zip |
33+
| Mac OS X | cli-VERSION_NUMBER-macos-arm64.zip |
3134
| Linux/Intel | cli-VERSION_NUMBER-linux-amd64.zip |
3235
| Raspbery Pi | cli-VERSION_NUMBER-raspbian-arm7.zip |
3336

3437

35-
## The basic recipe
38+
The basic recipe
39+
----------------
3640

3741
+ Find the Zip file listed matching the architecture you're running and download it
3842
+ (e.g. if you're on a Windows 10 laptop/Surface with a amd64 style CPU you'd choose the Zip file with "windows-amd64" in the name).
3943
+ Download the zip file and unzip the file.
4044
+ Copy the contents of the folder named "bin" to a folder that is in your path
4145
+ (e.g. "$HOME/bin" is common).
4246
+ Adjust your PATH if needed
43-
+ (e.g. `export PATH="$HOME/bin:$PATH"`)
47+
+ (e.g. export PATH="$HOME/bin:$PATH")
4448
+ Test
4549

4650

@@ -57,7 +61,7 @@ zip file.
5761

5862
```shell
5963
cd Downloads/
60-
unzip cli-*-macosx-amd64.zip
64+
unzip cli-*-macos-amd64.zip
6165
mkdir -p $HOME/bin
6266
cp -v bin/* $HOME/bin/
6367
export PATH=$HOME/bin:$PATH
@@ -126,7 +130,8 @@ downloading the zip file.
126130
```
127131

128132

129-
## Compiling from source
133+
Compiling from source
134+
---------------------
130135

131136
_cli_ is "go get-able". Use the "go get" command to download
132137
the dependant packages as well as _cli_'s source code.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Copyright (c) 2018, Caltech
2+
Copyright (c) 2021, Caltech
33
All rights not granted herein are expressly reserved by Caltech.
44

55
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,18 @@ dist/windows-amd64:
6161
cd dist && zip -r $(PROJECT)-$(VERSION)-windows-amd64.zip README.md LICENSE INSTALL.md bin/*
6262
rm -fR dist/bin
6363

64-
dist/macosx-amd64:
64+
dist/macos-amd64:
6565
mkdir -p dist/bin
6666
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/cligenerate cmd/cligenerate/cligenerate.go
6767
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/pkgassets cmd/pkgassets/pkgassets.go
68-
cd dist && zip -r $(PROJECT)-$(VERSION)-macosx-amd64.zip README.md LICENSE INSTALL.md bin/*
68+
cd dist && zip -r $(PROJECT)-$(VERSION)-macos-amd64.zip README.md LICENSE INSTALL.md bin/*
69+
rm -fR dist/bin
70+
71+
dist/macos-arm64:
72+
mkdir -p dist/bin
73+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/cligenerate cmd/cligenerate/cligenerate.go
74+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/pkgassets cmd/pkgassets/pkgassets.go
75+
cd dist && zip -r $(PROJECT)-$(VERSION)-macos-arm64.zip README.md LICENSE INSTALL.md bin/*
6976
rm -fR dist/bin
7077

7178
dist/raspbian-arm7:
@@ -82,7 +89,7 @@ distribute_docs:
8289
cp -v INSTALL.md dist/
8390
./package-versions.bash > dist/package-versions.txt
8491

85-
release: bootstrap distribute_docs dist/linux-amd64 dist/windows-amd64 dist/macosx-amd64 dist/raspbian-arm7
92+
release: bootstrap distribute_docs dist/linux-amd64 dist/windows-amd64 dist/macos-amd64 dist/macos-arm64 dist/raspbian-arm7
8693

8794
website:
8895
./mk-website.bash

cli.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @author R. S. Doiel, <[email protected]>
66
*
7-
* Copyright (c) 2018, Caltech
7+
* Copyright (c) 2021, Caltech
88
* All rights not granted herein are expressly reserved by Caltech.
99
*
1010
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -32,12 +32,12 @@ import (
3232
)
3333

3434
const (
35-
Version = `v0.0.16b`
35+
Version = `v0.0.17`
3636

3737
LicenseText = `
3838
%s %s
3939
40-
Copyright (c) 2018, Caltech
40+
Copyright (c) 2021, Caltech
4141
All rights not granted herein are expressly reserved by Caltech.
4242
4343
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -52,6 +52,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
5252
`
5353
)
5454

55+
// v0.0.17 Added go1.16 support
5556
//
5657
// v0.0.16 Verb.AddParams() was renamed Verb.SetParams()
5758
//

cli_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @author R. S. Doiel, <[email protected]>
66
*
7-
* Copyright (c) 2017, Caltech
7+
* Copyright (c) 2021, Caltech
88
* All rights not granted herein are expressly reserved by Caltech.
99
*
1010
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/cligenerate/cligenerate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @author R. S. Doiel, <[email protected]>
55
//
6-
// Copyright (c) 2018, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

codemeta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"codeRepository": "https://github.com/caltechlibrary/cli",
77
"issueTracker": "https://github.com/caltechlibrary/cli/issues",
88
"license": "https://data.caltech.edu/license",
9-
"version": "0.0.15",
9+
"version": "0.0.17",
1010
"author": [
1111
{
1212
"@type": "Person",
@@ -28,4 +28,4 @@
2828
"programmingLanguage": [
2929
"Go"
3030
]
31-
}
31+
}

docs/cligenerate.html

Lines changed: 54 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,76 +11,86 @@
1111
</header>
1212
<nav>
1313
<ul>
14-
<li><a href="/">Home</a></li>
15-
<li><a href="../index.html">README</a></li>
16-
<li><a href="../license.html">LICENSE</a></li>
17-
<li><a href="../install.html">INSTALL</a></li>
18-
<li><a href="./">Documentation</a></li>
19-
<li><a href="https://github.com/caltechlibrary/cli">Github</a></li>
14+
<li>
15+
<a href="/">Home</a>
16+
</li>
17+
<li>
18+
<a href="../index.html">README</a>
19+
</li>
20+
<li>
21+
<a href="../license.html">LICENSE</a>
22+
</li>
23+
<li>
24+
<a href="../install.html">INSTALL</a>
25+
</li>
26+
<li>
27+
<a href="./">Documentation</a>
28+
</li>
29+
<li>
30+
<a href="https://github.com/caltechlibrary/cli">Github</a>
31+
</li>
2032
</ul>
21-
2233
</nav>
2334

2435
<section>
25-
<h1>USAGE</h1>
26-
27-
<pre><code>cligenerate [OPTIONS]
28-
</code></pre>
29-
30-
<h2>SYNOPSIS</h2>
31-
32-
<p>The cli package and cli application generator
33-
provides a standard way to construct a command line interfaces
34-
encouraging uniformity across applications built at Caltech
35-
Library. The <em>cligenerator</em> program is intended primarily to be
36-
an example of how to use the <em>cli</em> package.</p>
37-
38-
<h2>DESCRIPTION</h2>
39-
40-
<p>This is a cli application generator. It also demonstrates
41-
how to use the cli package.</p>
42-
43-
<h2>OPTIONS</h2>
44-
45-
<p>Below are a set of options available.</p>
46-
36+
<h1 id="usage">
37+
USAGE
38+
</h1>
39+
<pre><code>cligenerate [OPTIONS]</code></pre>
40+
<h2 id="synopsis">
41+
SYNOPSIS
42+
</h2>
43+
<p>
44+
The cli package and cli application generator provides a standard way to construct a command line interfaces encouraging uniformity across applications built at Caltech Library. The <em>cligenerator</em> program is intended primarily to be an example of how to use the <em>cli</em> package.
45+
</p>
46+
<h2 id="description">
47+
DESCRIPTION
48+
</h2>
49+
<p>
50+
This is a cli application generator. It also demonstrates how to use the cli package.
51+
</p>
52+
<h2 id="options">
53+
OPTIONS
54+
</h2>
55+
<p>
56+
Below are a set of options available.
57+
</p>
4758
<pre><code> -app set the name of your generated app (e.g. helloworld)
4859
-e, -examples display examples
4960
-generate-manpage generate man page
5061
-generate-markdown generate markdown documentation
5162
-h, -help display help
5263
-i, -input input file name
5364
-l, -license display license
54-
-name, -author set the author name (e.g. '@author Jane Doe, &lt;[email protected]&gt;')
65+
-name, -author set the author name (e.g. &#39;@author Jane Doe, &lt;[email protected]&gt;&#39;)
5566
-nl, -newline if true add a trailing newline
5667
-o, -output output file name
5768
-p, -pretty pretty print output
5869
-quiet suppress error messages
59-
-synopsis set a short application description (e.g. says 'Hello World!')
70+
-synopsis set a short application description (e.g. says &#39;Hello World!&#39;)
6071
-use-bugs filename holding bugs
6172
-use-description filename holding a detailed description of application.
6273
-use-examples filename holding examples
6374
-use-license filename holding the license
64-
-v, -version display version
65-
</code></pre>
66-
67-
<h2>EXAMPLES</h2>
68-
69-
<p>Example generating a new &ldquo;helloworld&rdquo;</p>
70-
75+
-v, -version display version</code></pre>
76+
<h2 id="examples">
77+
EXAMPLES
78+
</h2>
79+
<p>
80+
Example generating a new helloworld
81+
</p>
7182
<pre><code> cligenerate -app=helloworld \
7283
-name=&quot;@author Jane Doe, &lt;[email protected]&gt;&quot; \
7384
-decription=&quot;This is a demo cli&quot; \
74-
-use-license=LICENSE
75-
</code></pre>
76-
77-
<p>cligenerate v0.0.14</p>
78-
85+
-use-license=LICENSE</code></pre>
86+
<p>
87+
cligenerate v0.0.14
88+
</p>
7989
</section>
8090

8191
<footer>
8292
<span><h1><A href="http://caltech.edu">Caltech</a></h1></span>
83-
<span>&copy; 2018 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
93+
<span>&copy; 2021 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
8494
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
8595
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
8696
<span><a href="mailto:[email protected]">Email Us</a></span>

docs/index.html

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,50 @@
1111
</header>
1212
<nav>
1313
<ul>
14-
<li><a href="/">Home</a></li>
15-
<li><a href="../index.html">README</a></li>
16-
<li><a href="../license.html">LICENSE</a></li>
17-
<li><a href="../install.html">INSTALL</a></li>
18-
<li><a href="./">Documentation</a></li>
19-
<li><a href="https://github.com/caltechlibrary/cli">Github</a></li>
14+
<li>
15+
<a href="/">Home</a>
16+
</li>
17+
<li>
18+
<a href="../index.html">README</a>
19+
</li>
20+
<li>
21+
<a href="../license.html">LICENSE</a>
22+
</li>
23+
<li>
24+
<a href="../install.html">INSTALL</a>
25+
</li>
26+
<li>
27+
<a href="./">Documentation</a>
28+
</li>
29+
<li>
30+
<a href="https://github.com/caltechlibrary/cli">Github</a>
31+
</li>
2032
</ul>
21-
2233
</nav>
2334

2435
<section>
25-
<h1>cli: building better command line interfaces</h1>
26-
27-
<p>This is a <a href="https://golang.org">go</a> package an a set
28-
of command line tools to help Caltech Library&rsquo;s Go
29-
based command line tools project have a unified
30-
set of behaviors and command line interface.</p>
31-
32-
<h2>The tools</h2>
33-
36+
<h1 id="cli-building-better-command-line-interfaces">
37+
cli: building better command line interfaces
38+
</h1>
39+
<p>
40+
This is a <a href="https://golang.org">go</a> package an a set of command line tools to help Caltech Library’s Go based command line tools project have a unified set of behaviors and command line interface.
41+
</p>
42+
<h2 id="the-tools">
43+
The tools
44+
</h2>
3445
<ul>
35-
<li><a href="cligenerate.html">cligenerate</a> - generates a skeleton cli app</li>
36-
<li><a href="pkgassets.html">pkgassets</a> - packages Markdown content for use in a cli app&rsquo;s help system (also used for generating man page and markdown content after the app is deployed)</li>
46+
<li>
47+
<a href="cligenerate.html">cligenerate</a> - generates a skeleton cli app
48+
</li>
49+
<li>
50+
<a href="pkgassets.html">pkgassets</a> - packages Markdown content for use in a cli app’s help system (also used for generating man page and markdown content after the app is deployed)
51+
</li>
3752
</ul>
38-
3953
</section>
4054

4155
<footer>
4256
<span><h1><A href="http://caltech.edu">Caltech</a></h1></span>
43-
<span>&copy; 2018 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
57+
<span>&copy; 2021 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
4458
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
4559
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
4660
<span><a href="mailto:[email protected]">Email Us</a></span>

0 commit comments

Comments
 (0)