Skip to content

Commit cc2ccec

Browse files
authored
Merge pull request #1 from reugn/develop
v0.2.0
2 parents c5ae66e + 1d137b9 commit cc2ccec

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

.github/.goreleaser.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
project_name: wifiqr
2+
builds:
3+
- env: [CGO_ENABLED=0]
4+
goos:
5+
- linux
6+
- windows
7+
- darwin
8+
goarch:
9+
- amd64
10+
- arm64
11+
archives:
12+
- replacements:
13+
darwin: macos
14+
amd64: x86_64
15+
format_overrides:
16+
- goos: windows
17+
format: zip

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- '*'
6+
- 'v*'
77

88
jobs:
99
goreleaser:
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v2
1919
with:
20-
go-version: 1.15.x
20+
go-version: 1.16.x
2121

2222
- name: Run GoReleaser
2323
uses: goreleaser/goreleaser-action@v2

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
go-version: [1.14.x, 1.15.x]
10+
go-version: [1.15.x, 1.16.x]
1111
steps:
1212
- name: Setup Go
1313
uses: actions/setup-go@v2

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Create a QR code with your Wi-Fi login details.
1010
Use Google Lens or other application to scan it and connect automatically.
1111

1212
## Installation
13+
Pick a binary from the [releases](https://github.com/reugn/wifiqr/releases).
14+
15+
### Build from source
1316
Download and install Go https://golang.org/doc/install.
1417

1518
Clone the repository:
@@ -30,8 +33,8 @@ Usage of ./wifiqr:
3033
The wireless network encryption protocol (WEP, WPA, WPA2). (default "WPA2")
3134
-file string
3235
A png file to write the QR Code (prints to stdout if not set).
33-
-hidden string
34-
Hidden SSID true/false. (default "false")
36+
-hidden
37+
Hidden SSID.
3538
-key string
3639
A pre-shared key (PSK). You'll be prompted to enter the key if not set.
3740
-size int

cmd/wifiqr/main.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ import (
55
"fmt"
66
"os"
77
"path/filepath"
8-
"strconv"
98

109
"github.com/reugn/wifiqr"
1110
)
1211

13-
const version = "0.1.0"
12+
const version = "0.2.0"
1413

1514
var (
1615
versionParam = flag.Bool("version", false, "Show version.")
1716

1817
ssidParam = flag.String("ssid", "", "The name of the wireless network. You'll be prompted to enter the SSID if not set.")
1918
keyParam = flag.String("key", "", "A pre-shared key (PSK). You'll be prompted to enter the key if not set.")
2019
encParam = flag.String("enc", "WPA2", "The wireless network encryption protocol (WEP, WPA, WPA2).")
21-
hiddenParam = flag.String("hidden", "false", "Hidden SSID true/false.")
20+
hiddenParam = flag.Bool("hidden", false, "Hidden SSID.")
2221

2322
fileNameParam = flag.String("file", "", "A png file to write the QR Code (prints to stdout if not set).")
2423
sizeParam = flag.Int("size", 256, "Size is both the image width and height in pixels.")
@@ -34,7 +33,7 @@ func main() {
3433

3534
validateArguments()
3635

37-
config := wifiqr.NewConfig(*ssidParam, *keyParam, *encParam, validateAndGetHidden())
36+
config := wifiqr.NewConfig(*ssidParam, *keyParam, *encParam, *hiddenParam)
3837
q, err := wifiqr.InitCode(config)
3938
if err != nil {
4039
fmt.Println(err)
@@ -62,15 +61,6 @@ func validateAndGetFileName() string {
6261
return *fileNameParam
6362
}
6463

65-
func validateAndGetHidden() bool {
66-
hidden, err := strconv.ParseBool(*hiddenParam)
67-
if err != nil {
68-
fmt.Println(err)
69-
os.Exit(1)
70-
}
71-
return hidden
72-
}
73-
7464
func validateArguments() {
7565
if *ssidParam == "" {
7666
fmt.Println("Enter the name of the wireless network (SSID):")

0 commit comments

Comments
 (0)