• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ronelliott / snek
97%
master: 94%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Repo Added 27 Dec 2023 05:15PM UTC
Files 6
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH main
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • main
  • master

28 Mar 2026 03:45AM UTC coverage: 97.118% (-0.5%) from 97.57%
23676774764

push

github

web-flow
Fix root command with subcommands rejecting positional args (#6)

* Fix root command with subcommands rejecting positional args

When a root command had both a Run/RunE handler and subcommands, cobra's
legacyArgs validation in Find() would reject any positional arguments
with an "unknown command" error. Auto-apply ArbitraryArgs on the root
command when no custom Args validator has been set to restore expected
behavior.

Also replace cobra.OnInitialize with PersistentPreRunE for logging setup.
cobra.OnInitialize appends to a package-level global, causing initializers
to accumulate across multiple Run() calls (e.g. in tests). PersistentPreRunE
scopes the hook to the command tree and propagates errors through Execute()
instead of calling os.Exit(1) directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Address Copilot review comments

- Fix PersistentPreRunE chaining: when both existingPreRunE and
  existingPreRun are set, both now run. Previously existingPreRunE's
  early return skipped existingPreRun entirely.
- Redirect log output to io.Discard in the three new execution tests
  so they don't emit "Logging initialized." to stdout during the test run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

13 of 20 new or added lines in 1 file covered. (65.0%)

775 of 798 relevant lines covered (97.12%)

10.55 hits per line

Relevant lines Covered
Build:
Build:
798 RELEVANT LINES 775 COVERED LINES
10.55 HITS PER LINE
Source Files on master
  • Tree
  • List 6
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
23676774764 main Fix root command with subcommands rejecting positional args (#6) * Fix root command with subcommands rejecting positional args When a root command had both a Run/RunE handler and subcommands, cobra's legacyArgs validation in Find() would reject ... push 28 Mar 2026 03:46AM UTC web-flow github
97.12
23224579366 main Add environment variable overrides for CLI flags (#5) push 18 Mar 2026 01:25AM UTC web-flow github
97.57
20765121888 main Add missing int and uint flag initializer variants (#4) * Initial plan * Add missing uint and int flag initializers with tests and documentation Co-authored-by: ronelliott <1023373+ronelliott@users.noreply.github.com> * Add .gitignore to exclu... push 06 Jan 2026 11:17PM UTC web-flow github
95.58
17046483676 main Merge pull request #2 from ronelliott/ronelliott/dependency-upgrade Update go dependencies push 18 Aug 2025 04:30PM UTC web-flow github
94.57
17046409080 main Merge pull request #1 from ronelliott/ronelliott/add-int64-flags Add Int64 flag types push 18 Aug 2025 04:26PM UTC web-flow github
94.57
15029524692 main Rename master branch to main push 14 May 2025 07:38PM UTC Ron Elliott github
94.41
14696803803 master Export log format strings. push 27 Apr 2025 10:36PM UTC Ron Elliott github
94.41
10432907880 master Add alias for cobra.Command push 17 Aug 2024 02:17PM UTC ronelliott github
94.41
7343939283 master Add example for flags. push 28 Dec 2023 02:57AM UTC ronelliott github
94.41
7343633541 master Reorder badges push 28 Dec 2023 02:02AM UTC ronelliott github
94.41
See All Builds (15)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc