73 Commits

Author SHA1 Message Date
T. R. Bernstein
d2ae7b645f config: Replace ~ with user's home directory path
Some checks failed
Test / lint (push) Has been cancelled
Test / test (1.17.x) (push) Has been cancelled
Test / test (1.18.x) (push) Has been cancelled
Test / test (1.19.x) (push) Has been cancelled
Test / test (1.20.x) (push) Has been cancelled
Test / test (1.21.x) (push) Has been cancelled
Test / test (1.22.x) (push) Has been cancelled
Test / test (1.23.x) (push) Has been cancelled
Test / test (1.24.x) (push) Has been cancelled
2025-08-05 00:48:52 +02:00
T. R. Bernstein
52ba6ab4b3 config: Refactor Get methods 2025-08-05 00:48:48 +02:00
T. R. Bernstein
df836a9f8e Update for new repository location
Some checks failed
Test / lint (push) Has been cancelled
Test / test (1.17.x) (push) Has been cancelled
Test / test (1.18.x) (push) Has been cancelled
Test / test (1.19.x) (push) Has been cancelled
Test / test (1.20.x) (push) Has been cancelled
Test / test (1.21.x) (push) Has been cancelled
Test / test (1.22.x) (push) Has been cancelled
Test / test (1.23.x) (push) Has been cancelled
Test / test (1.24.x) (push) Has been cancelled
2025-08-04 22:29:41 +02:00
T. R. Bernstein
511052e2fd config: Implement percent TOKEN substitution
Some checks failed
Test / lint (push) Has been cancelled
Test / test (1.17.x) (push) Has been cancelled
Test / test (1.18.x) (push) Has been cancelled
Test / test (1.19.x) (push) Has been cancelled
Test / test (1.20.x) (push) Has been cancelled
Test / test (1.21.x) (push) Has been cancelled
Test / test (1.22.x) (push) Has been cancelled
Test / test (1.23.x) (push) Has been cancelled
Test / test (1.24.x) (push) Has been cancelled
2025-08-04 20:51:42 +02:00
T. R. Bernstein
a07d8f5c66 config: support ~ as user's home directory for Include 2025-08-04 18:12:36 +02:00
Kevin Burke
1bd630c105 1.3 2025-02-20 00:21:01 -08:00
Kevin Burke
200a8b4c54 .github: update CI for more recent Go versions 2025-02-20 00:20:14 -08:00
Kevin Burke
1d09c0b505 .github: set latest Go versions 2023-10-21 21:24:32 -07:00
Kevin Burke
974a52c2c0 .github: use Go 1.19 2022-11-25 07:46:23 -08:00
Kevin Burke
3c7724c1bb README.md: update donate information 2022-11-08 20:20:52 -08:00
Kevin Burke
7df8445052 go.mod: add 2022-06-15 09:39:52 -07:00
Kevin Burke
a56e914e72 .github: run lint only on Go 1.18 2022-06-05 13:48:31 -07:00
Kevin Burke
5724bd1279 config: add UserSettings.ConfigFinder
Fixes #48.
2022-06-05 12:47:11 -07:00
Kevin Burke
aae6f39972 1.2 2022-03-31 11:37:00 -07:00
Kevin Burke
df4d8e6716 config: update version to match git tags 2022-03-31 11:36:52 -07:00
Kevin Burke
f6c7111323 Makefile: add tag prefix to release command
This makes go.mod happier.
2022-03-31 10:59:35 -07:00
Scott Lessans
9b1b4df300 config: fix EOL whitespace for key/value pairs and Host lines
See the description in the CHANGELOG - we were handling this
incorrectly and attaching whitespace to the end of values where that
didn't make much sense to do.
2022-03-31 10:57:24 -07:00
Carlos A Becker
91cd224c7f config: add DecodeBytes to directly read a byte array
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-03-31 09:49:09 -07:00
Kevin Burke
a432d6fbae README: add more information 2022-03-31 09:31:12 -07:00
Kevin Burke
6ad71ac26e config: remove io/ioutil
It's deprecated now.
2022-03-31 09:26:24 -07:00
Kevin Burke
0970dd2cc4 .github: add latest Go versions to CI 2022-03-31 09:22:50 -07:00
Kevin Burke
c7f8dec5c7 fuzz_test: add fuzz tests
Also add a sample corpus.
2021-11-02 14:58:53 -07:00
Kevin Burke
beb851b6a4 AUTHORS.txt: add Dustin Spicuzza 2021-03-27 13:54:12 -07:00
Dustin Spicuzza
124166206d Support retrieving multiple values for a given keyword
IdentityFile among others supports being provided multiple times and
aggregated across, potentially, multiple files. Support that workflow
by adding GetAll and GetAllStrict alongside the current functions.
2021-03-27 13:38:21 -07:00
Kevin Burke
42c0635e2f .github: add github actions 2021-03-27 10:07:43 -07:00
santosh653
4977a11b43 travis.yml: test ppc64le 2020-11-05 21:09:09 -08:00
santosh653
62d16166c6 Update .travis.yml
Adding Power Support
2020-11-05 21:08:12 -08:00
Kevin Burke
5a772a75fa travis.yml: test latest Go versions
Staticcheck only works going back to Go 1.13 so only test that far
back.
2020-11-05 21:06:12 -08:00
Kevin Burke
01f96b0aa0 AUTHORS.txt: add Mark Nevill
Also change addresses to use my new email.
2019-07-24 19:47:13 -10:00
Kevin Burke
6cfae18c12 1.0 2019-07-24 10:58:21 -10:00
Mark Nevill
14846fb743 all: rewrite the lexer to consume the entire input first
Previously we used the buffruneio package to buffer input. However,
the error handling was not good, and we would often panic when parsing
inputs.

SSH config files are generally not large, on the order of kilobytes or
megabytes, and it's fine to just read the entire thing into memory and
then parse from there. This also simplifies the parser significantly
and lets us remove a dependency and several defer calls.

Add a test that panicked with the old version and then modify the code
to ensure the test no longer panics.

Thanks to Mark Nevill (@devnev) for the initial error report and
failing test case.

Fixes #10.
Fixes #24.
2019-07-24 10:52:01 -10:00
Kevin Burke
2e50c44127 all: fix lint issues
staticcheck updated, and it requires inline fixes as well as dropping
support for 1.9 and 1.10.
2019-06-29 21:04:20 -07:00
Kevin Burke
f648cfb84b all: use ints instead of uints
Files are small and these are cheap enough that we should be more
worried about overflow errors than the space cost.
2019-06-29 20:37:49 -07:00
Kevin Burke
81db2a7582 0.5 2018-08-30 14:53:28 -06:00
Kevin Burke
b64c0219b6 Add Go 1.11 to build matrix 2018-08-30 14:47:24 -06:00
Kevin Burke
555f37af0a Correctly parse files without trailing newline
If the file did not have a newline character as the last character,
parseKV() would panic with an NPE. Handle the parser changes better.

Fixes #21.
2018-08-30 14:46:27 -06:00
Kevin Burke
82cf3f9264 Remove 1.7 and 1.8 from build matrix
They don't work with megacheck anymore. The source code and tests will
probably still pass, however.
2018-07-11 09:47:46 -07:00
Kevin Burke
4fcc689bee Use kevinburke/bump_version instead of Shyp/bump_version 2018-04-22 12:34:03 -07:00
Wayne Ashley Berry
6c3af74fa5 Run tests with the race detector
At some point recently this was fixed (maybe investigate more and
figure out how/why this has been resolved?)

Add Go 1.10 to Travis CI.
2018-04-02 20:41:57 -07:00
Kevin Burke
b8c871d977 run tests before releasing a new version 2018-03-17 10:56:17 -07:00
Kevin Burke
9fc7bb800b 0.4 2018-03-17 10:55:31 -07:00
Eugene Terentev
fe204ef364 Fix DOS line endings parsing
Previously we would fail to lex lines ending with CRLF properly.
2018-03-17 10:50:38 -07:00
Kevin Burke
0ff8514904 0.3 2018-01-27 11:48:58 -08:00
Kevin Burke
fc20c60f74 Add AUTHORS file 2018-01-27 11:48:38 -08:00
Sergey Lukjanov
c665f6f442 Fix potential index out of range error
I had some extra spaces and junk in my ssh config and it was causing
this part of the code to fail with an out of range error.
2018-01-27 11:46:18 -08:00
Kevin Burke
802051befe Implement encoding.TextMarshaler interface 2017-10-13 14:14:58 -07:00
Kevin Burke
db49ba357d Use better dependencies in Makefile 2017-08-22 10:15:53 -07:00
Kevin Burke
4ec3da02a7 add Default example 2017-05-26 11:07:48 -07:00
Kevin Burke
fc8c332031 fix example 2017-05-26 11:06:09 -07:00
Kevin Burke
2b54512628 switch staticcheck for megacheck and fix things it complains about 2017-05-26 10:01:24 -07:00