From bf51875b98597778ec03c776613cc20a13fffd1f Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Tue, 23 Jul 2024 18:20:34 +0530 Subject: [PATCH] cleanup: update files Signed-off-by: K.B.Dharun Krishna --- .github/dependabot.yml | 2 +- .github/workflows/go.yml | 22 +++---- .github/workflows/release.yml | 82 +++++++++++++++----------- .goreleaser.yaml | 40 ------------- COPYING.md => LICENSE.md | 0 README.md | 10 ++-- VERSION | 1 - debian/changelog | 76 ------------------------ debian/compat | 1 - debian/control | 21 ------- debian/copyright | 24 -------- debian/files | 1 - debian/gbp.conf | 2 - debian/rules | 6 -- debian/vanilla-system-operator.install | 6 -- go.mod | 30 +++++----- go.sum | 27 +++++++++ locales/en.yml | 12 ++++ main.go | 16 ++++- 19 files changed, 132 insertions(+), 247 deletions(-) delete mode 100644 .goreleaser.yaml rename COPYING.md => LICENSE.md (100%) delete mode 100644 VERSION delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/files delete mode 100644 debian/gbp.conf delete mode 100755 debian/rules delete mode 100644 debian/vanilla-system-operator.install diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fd7a33cb..0cfc43cd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,7 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "monthly" + interval: "weekly" - package-ecosystem: "gomod" directory: "/" schedule: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8b0674b0..5bf27b10 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,7 +31,7 @@ jobs: apt-get install -y pkg-config build-essential - name: Build - run: go build -o vso + run: go build -o vso -ldflags="-X 'main.Version=${{ github.sha }}'" - name: Check for missing strings uses: vanilla-os/missing-strings-golang-action@v0.1.0 @@ -42,26 +42,26 @@ jobs: - name: Compress-manpage run: tar -czvf vso-man.tar.gz man/vso.1 + - name: Calculate and Save Checksums + run: | + sha256sum vso.tar.gz >> checksums.txt + sha256sum vso-man.tar.gz >> checksums.txt + - uses: actions/upload-artifact@v4 with: name: vso - path: vso.tar.gz + path: | + checksums.txt + vso.tar.gz + vso-man.tar.gz - uses: softprops/action-gh-release@v2 - if: github.repository == 'vanilla-os/vanilla-system-operator' && github.ref == 'refs/heads/main' with: token: "${{ secrets.GITHUB_TOKEN }}" tag_name: "continuous" prerelease: true name: "Continuous Build" files: | + checksums.txt vso.tar.gz vso-man.tar.gz - - - name: Attest continuous release files - if: github.repository == 'vanilla-os/vanilla-system-operator' && github.ref == 'refs/heads/main' - uses: actions/attest-build-provenance@v1 - with: - subject-path: | - vso.tar.gz - vso-man.tar.gz diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c58b80c..78deb7d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: goreleaser +name: Release on: push: @@ -6,38 +6,16 @@ on: - '*' jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.22 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 - with: - distribution: goreleaser - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - upload-artifacts: + build-artifacts: runs-on: ubuntu-latest container: image: ghcr.io/vanilla-os/pico:main permissions: - contents: write # Allow uploading assets to release - attestations: write # To create and write attestations - id-token: write # Additional permissions for persistence of the attestations + contents: read steps: - uses: actions/checkout@v4 + - name: Set up Go uses: actions/setup-go@v5 with: @@ -49,24 +27,56 @@ jobs: apt-get install -y pkg-config build-essential - name: Build - run: go build -o vso - + run: go build -o vso -ldflags="-X 'main.Version=${{ github.ref_name }}'" + + - name: Check for missing strings + uses: vanilla-os/missing-strings-golang-action@v0.1.0 + - name: Compress run: tar -czvf vso.tar.gz vso - name: Compress-manpage run: tar -czvf vso-man.tar.gz man/vso.1 - - uses: softprops/action-gh-release@v2 + - name: Calculate and Save Checksums + run: | + sha256sum vso.tar.gz >> checksums.txt + sha256sum vso-man.tar.gz >> checksums.txt + + - uses: actions/upload-artifact@v4 with: - token: "${{ secrets.GITHUB_TOKEN }}" - files: | + name: vso + path: | + checksums.txt vso.tar.gz vso-man.tar.gz - - - name: Attest release files + + release: + runs-on: ubuntu-latest + needs: build-artifacts + permissions: + contents: write # to create and upload assets to releases + attestations: write # to upload assets attestation for build provenance + id-token: write # grant additional permission to attestation action to mint the OIDC token permission + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: vso + + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release create "${{ github.ref_name }}" --generate-notes *.tar.gz checksums.txt + + - name: Attest Release Files + id: attest uses: actions/attest-build-provenance@v1 with: - subject-path: | - vso.tar.gz - vso-man.tar.gz + subject-path: '*.tar.gz, checksums.txt' diff --git a/.goreleaser.yaml b/.goreleaser.yaml deleted file mode 100644 index 2368e584..00000000 --- a/.goreleaser.yaml +++ /dev/null @@ -1,40 +0,0 @@ -before: - hooks: - - go mod tidy - - go generate ./... - -builds: - - env: - - CGO_ENABLED=0 - goos: - - linux - goarch: - - amd64 - ldflags: - - -s -w -X main.Version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser - -archives: - - format: tar.gz - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} - format_overrides: - - goos: windows - format: zip - -checksum: - disable: true - -snapshot: - name_template: "{{ incpatch .Version }}-next" - -changelog: - sort: asc - filters: - exclude: - - '^wip:' - - '^test:' diff --git a/COPYING.md b/LICENSE.md similarity index 100% rename from COPYING.md rename to LICENSE.md diff --git a/README.md b/README.md index aeca8b57..182c3407 100644 --- a/README.md +++ b/README.md @@ -21,25 +21,27 @@ Usage: vso [command] Available Commands: + android Manage the vso waydroid subsystem completion Generate the autocompletion script for the specified shell config Manage the system configuration. export Export an application or binary from the subsystem help Help about any command install Install an application inside the subsystem - pico-init Initialize the Pico subsystem, used for package management + pico-init Initialize the VSO subsystem, used for package management remove Remove an application from the subsystem run Run an application from the subsystem search Search for an application to install inside the subsystem shell Enter the subsystem environment - sys Execute system tasks, such as upgrading the system + sideload Sideload DEB/APK packages inside the subsystem + sys Execute system commands, such as upgrading the system tasks Create and manage tasks unexport Unexport an application or binary from the subsystem update Update the subsystem's package repository upgrade Upgrade the packages inside the subsystem Flags: - -h, --help help for vso - -v, --version version for vso + -h, --help Show help for vso. + -v, --version Show version for vso. Use "vso [command] --help" for more information about a command. ``` diff --git a/VERSION b/VERSION deleted file mode 100644 index f93ea0ca..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.0.2 \ No newline at end of file diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 105f4771..00000000 --- a/debian/changelog +++ /dev/null @@ -1,76 +0,0 @@ -vanilla-system-operator (1.3.6) unstable; urgency=critical - - * Adapt to ABRoot v2 - - -- Mirko brombin Mon, 13 Feb 2023 22:44:00 +0200 - -vanilla-system-operator (1.3.5) unstable; urgency=critical - - * Defer updates until first-setup is complete - - -- Mirko brombin Mon, 13 Feb 2023 22:44:00 +0200 - -vanilla-system-operator (1.3.4-1) kinetic; urgency=critical - - * Defer updates until first-setup is complete - - -- Mirko brombin Mon, 13 Feb 2023 22:44:00 +0200 - -vanilla-system-operator (1.3.3) kinetic; urgency=critical - - * Add polkit rules for allowing update-check to run without sudo - - -- Mirko brombin Sat, 04 Feb 2023 21:07:00 +0200 - -vanilla-system-operator (1.3.2) kinetic; urgency=critical - - * Fix SmartUpdate being triggered even on forced mode - * Fix examples in the config help - - -- Mirko brombin Sun, 29 Jan 2023 15:56:00 +0200 - -vanilla-system-operator (1.3.1-3) kinetic; urgency=critical - - * Fix wrong reported update date - * Adapt to ABRoot 1.3.1 - - -- Mirko brombin Mon, 16 Jan 2023 17:35:00 +0200 - -vanilla-system-operator (1.3.0-5) kinetic; urgency=critical - - * New task events for internet, memory, cpu usage and temperature - * Deleting tasks is now case insensitive - * Fix wrong reported memory usage - - -- Mirko brombin Fri, 13 Jan 2023 23:32:00 +0200 - -vanilla-system-operator (1.2.0-1) kinetic; urgency=critical - - * Add cpu temperature check - * Improve memory check - * Improve cpu check - * Improve battery check - * Ability to check for updates - * Check for updates before starting a new transaction - * Minor bugfixes and code improvements - - -- Mirko brombin Sun, 02 Jan 2023 12:17:34 +0200 - -vanilla-system-operator (1.1.5) kinetic; urgency=critical - - * Improve SmartUpdate - - -- Mirko brombin Sun, 02 Jan 2023 12:17:34 +0200 - -vanilla-system-operator (1.1.3) kinetic; urgency=critical - - * Rework battery check - - -- Mirko brombin Sun, 01 SJan 2022 17:13:34 +0200 - -vanilla-system-operator (1.1.1) kinetic; urgency=critical - - * Support tasks relations/dependencies - * Add manpage (man vso) - - -- Mirko brombin Wen, 16 Sep 2022 23:26:34 +0200 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 48082f72..00000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -12 diff --git a/debian/control b/debian/control deleted file mode 100644 index 70677202..00000000 --- a/debian/control +++ /dev/null @@ -1,21 +0,0 @@ -Source: vanilla-system-operator -Section: devel -Priority: extra -Maintainer: Mirko Brombin -Uploaders: Mirko Brombin -Build-Depends: debhelper (>= 9), - dh-golang, - golang-go -Standards-Version: 3.9.6 -Homepage: https://github.com/vanilla-os/vanilla-system-operator -Vcs-Browser: https://github.com/vanilla-os/vanilla-system-operator -Vcs-Git: git://github.com/vanilla-os/vanilla-system-operator.git - -Package: vanilla-system-operator -Architecture: all -Depends: ${shlibs:Depends}, - ${misc:Depends}, - adwdialog, - ifstat -Built-Using: ${misc:Built-Using} -Description: VSO is an utility which allows you to perform maintenance tasks on your Vanilla OS installation. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 851c5947..00000000 --- a/debian/copyright +++ /dev/null @@ -1,24 +0,0 @@ -Format: http://dep.debian.net/deps/dep5 -Upstream-Name: Vanilla OS First Setup -Source: https://github.com/vanilla-os/ - -Files: * -Copyright: 2024 Vanilla-OS contributors -License: GPL-3.0 - -License: GPL-3.0 - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General - Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". - \ No newline at end of file diff --git a/debian/files b/debian/files deleted file mode 100644 index dbc759b0..00000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -vanilla-system-operator_1.3.4-1_source.buildinfo devel extra diff --git a/debian/gbp.conf b/debian/gbp.conf deleted file mode 100644 index cec628c7..00000000 --- a/debian/gbp.conf +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -pristine-tar = True diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 000e3e53..00000000 --- a/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DH_GOPKG := github.com/vanilla-os/vanilla-system-operator - -%: - dh $@ diff --git a/debian/vanilla-system-operator.install b/debian/vanilla-system-operator.install deleted file mode 100644 index 82030d3b..00000000 --- a/debian/vanilla-system-operator.install +++ /dev/null @@ -1,6 +0,0 @@ -config/config.json /etc/vso/ -man/vso.1 /usr/share/man/man1 -man/es/vso.1 /usr/share/man/es/man1 -man/fr/vso.1 /usr/share/man/fr/man1 -polkit/org.vanillaos.vso.rules /usr/share/polkit-1/rules.d/ -polkit/org.vanillaos.vso.policy /usr/share/polkit-1/actions/ diff --git a/go.mod b/go.mod index ab2699a1..5e2db523 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,15 @@ module github.com/vanilla-os/vanilla-system-operator -go 1.21.4 - -toolchain go1.21.5 +go 1.22 require ( - github.com/BurntSushi/toml v1.3.2 + github.com/BurntSushi/toml v1.4.0 github.com/buger/jsonparser v1.1.1 github.com/olekukonko/tablewriter v0.0.5 - github.com/spf13/cobra v1.8.0 - github.com/vanilla-os/apx/v2 v2.4.2 - github.com/vanilla-os/orchid v0.5.0 - go.etcd.io/bbolt v1.3.8 + github.com/spf13/cobra v1.8.1 + github.com/vanilla-os/apx/v2 v2.4.3 + github.com/vanilla-os/orchid v0.6.0 + go.etcd.io/bbolt v1.3.10 ) require ( @@ -27,13 +25,13 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/pelletier/go-toml/v2 v2.2.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pterm/pterm v0.12.79 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/locafero v0.6.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect @@ -41,10 +39,10 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -53,5 +51,5 @@ require ( require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.18.2 + github.com/spf13/viper v1.19.0 ) diff --git a/go.sum b/go.sum index 9b0980ab..459b3a89 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs= atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs= github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8= github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII= @@ -68,12 +70,17 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -95,6 +102,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= +github.com/sagikazarmark/locafero v0.6.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -107,10 +116,14 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -127,20 +140,28 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/vanilla-os/apx/v2 v2.4.2 h1:csyPY1zMnbU5dzsA3g8rV58299iA2ZufSQOavsc1r30= github.com/vanilla-os/apx/v2 v2.4.2/go.mod h1:xaZpI6lDmCI2qrRMUncrOZASmskKLM+s/Fo1Ij1Br58= +github.com/vanilla-os/apx/v2 v2.4.3 h1:EWJLCyX/Dzfmn7NxrHv15LRiKiHV/y4wc8NaPxwb3Eo= +github.com/vanilla-os/apx/v2 v2.4.3/go.mod h1:4W6XkjspaaYy0ckzrMTyWghPkVwXr2s+TDf/pfEhN1w= github.com/vanilla-os/orchid v0.5.0 h1:QAOjJ2VcyND5TxK0XYUEu+dysxXicRHhV6i/07S47mk= github.com/vanilla-os/orchid v0.5.0/go.mod h1:dNPvHxofO4hEXodEKXp0nLQDZhoHh8evCUXc6X1xLao= +github.com/vanilla-os/orchid v0.6.0 h1:aH7i621QrqtbspGUie4To28zCk1u1UvGHGzL11wdldE= +github.com/vanilla-os/orchid v0.6.0/go.mod h1:dNPvHxofO4hEXodEKXp0nLQDZhoHh8evCUXc6X1xLao= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -163,6 +184,8 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -170,6 +193,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -177,6 +202,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/locales/en.yml b/locales/en.yml index 25deff00..a3c07c32 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -6,6 +6,18 @@ vso: invalidChoice: "Invalid choice." info: aborting: "Aborting as requested." + msg: + help: "Show help for vso." + version: "Show version for vso." + usage: "Usage" + aliases: "Aliases" + examples: "Examples" + availableCommands: "Available Commands" + additionalCommands: "Additional Commands" + flags: "Flags" + globalFlags: "Global Flags" + additionalHelpTopics: "Additional help topics" + moreInfo: "Use %s for more information about a command" terminal: yes: "yes" no: "no" diff --git a/main.go b/main.go index 9a175bc0..a21663e6 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,7 @@ import ( "github.com/vanilla-os/vanilla-system-operator/cmd" ) -var Version = "2.0.1" +var Version = "development" //go:embed locales/*.yml var fs embed.FS @@ -37,6 +37,20 @@ func main() { // root command root := cmd.NewRootCommand(Version) vso.CreateRootCommand(root) + vso.CreateRootCommand(root, vso.Trans("vso.msg.help"), vso.Trans("vso.msg.version")) + + msgs := cmdr.UsageStrings{ + Usage: vso.Trans("vso.msg.usage"), + Aliases: vso.Trans("vso.msg.aliases"), + Examples: vso.Trans("vso.msg.examples"), + AvailableCommands: vso.Trans("vso.msg.availableCommands"), + AdditionalCommands: vso.Trans("vso.msg.additionalCommands"), + Flags: vso.Trans("vso.msg.flags"), + GlobalFlags: vso.Trans("vso.msg.globalFlags"), + AdditionalHelpTopics: vso.Trans("vso.msg.additionalHelpTopics"), + MoreInfo: vso.Trans("vso.msg.moreInfo"), + } + vso.SetUsageStrings(msgs) // commands tasks := cmd.NewTasksCommand()