Skip to content

Conversation

@starius
Copy link
Collaborator

@starius starius commented Oct 7, 2025

Summary

  • Upgraded the Loop CLI to urfave/cli/v3, adjusted every command/action to the new API
  • Hardened user input across commands by parsing numeric flags with their native helpers, rejecting negative amounts, and keeping static-address labels consistent.
  • Added loop man / loop markdown helpers plus Make/Ci steps that regenerate manpages/markdown and verify docs stay up to date.
  • Hid the development-only forceautoloop command from end users.

Testing

  • make build
  • loop man
  • loop markdown
  • make docs-check
  • Manually testing loop to make sure it works properly

@starius starius force-pushed the urfave-cli-updates branch from ae27cf6 to f928b4f Compare October 7, 2025 06:35
@starius starius marked this pull request as ready for review October 7, 2025 06:47
Copy link
Member

@sputn1ck sputn1ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Cool addition with the doc generation!

autoloop timer. THIS MUST NOT BE USED IN A PROD ENVIRONMENT.
`,
Action: forceAutoloop,
Hidden: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command is already hidden behind the dev build flag, but nothing wrong with adding extra hidden flag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The man and the markdown are built using loop-debug binary built by make build. That target builds with "dev" tag.

Copy link
Member

@bhandras bhandras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM!!

@@ -0,0 +1,80 @@
{{ define "flags" }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool!

It is not intended for prod use. Those who need it can still use it.
urfave/cli/v3 returns "" if an int flag is accessed using String getter.
urfave/cli/v3 returns "" if an int flag is accessed using String getter.
Previously it was parsed as a single JSON string. Now each hint is parsed
individually.
Previous version validated the value of non-existent flag "static-loop-in".
The value passed to loopd was correct though.
@starius starius force-pushed the urfave-cli-updates branch from f928b4f to 71b62c0 Compare October 7, 2025 17:21
@starius
Copy link
Collaborator Author

starius commented Oct 7, 2025

Rebased

@starius starius force-pushed the urfave-cli-updates branch from 71b62c0 to ab8ea4a Compare October 7, 2025 18:21
@starius
Copy link
Collaborator Author

starius commented Oct 7, 2025

Updated static loop in usage:

USAGE:
   loop static in [amt] [--all | --utxo xxx:xx]

Updated docs for --fast flag and fixed make docs-check so it actually catches if docs is outdated.

@starius starius force-pushed the urfave-cli-updates branch 2 times, most recently from 3f2d803 to eac8e7b Compare October 7, 2025 19:19
Produce the documentations in man .1 and markdown formats.

The template for markdown was patched to removed column "Environment variables"
Upstream PR: urfave/cli-docs#15

Also the input has to be pre-processed to remove nested "help" subcommands from
each subcommand to improve readability.
Upstream PR: urfave/cli-docs#16
@starius starius force-pushed the urfave-cli-updates branch from eac8e7b to 9eddee7 Compare October 7, 2025 19:55
@starius
Copy link
Collaborator Author

starius commented Oct 7, 2025

Fixed documentation generation to put paths like ~/.loop instead of expanded paths like /home/user/.loop which were breaking reproducibility.

CI was catching this with diffs like this:

-\fB--loopdir\fP="": path to loop's base directory (default: /home/user/.loop)
+\fB--loopdir\fP="": path to loop's base directory (default: /home/runner/.loop)

@starius starius merged commit 113f716 into lightninglabs:master Oct 7, 2025
6 checks passed
@starius starius deleted the urfave-cli-updates branch October 7, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants