add more help text

This commit is contained in:
filifa
2025-09-17 21:02:05 -04:00
parent 4b4858c54f
commit 9e6f648f0b
14 changed files with 126 additions and 42 deletions

View File

@@ -49,9 +49,14 @@ func convergents(cmd *cobra.Command, args []string) {
var convergentsCmd = &cobra.Command{
Use: "convergents N N [N ...]",
Short: "Compute convergents of a periodic continued fraction",
Long: `Compute convergents of a periodic continued fraction.`,
Args: cobra.MinimumNArgs(2),
Run: convergents,
Long: `Compute convergents of a periodic continued fraction.
The first number given is the integer part. The following numbers give the repetend of the continued fraction.
This will output convergents infinitely. Try piping to head to only output a certain number of convergents, like this:
mathtools convergents 3 2 6 | head -n 5`,
Args: cobra.MinimumNArgs(2),
Run: convergents,
}
func init() {