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

@@ -69,9 +69,12 @@ func gcd(cmd *cobra.Command, args []string) {
var gcdCmd = &cobra.Command{
Use: "gcd N N [N ...]",
Short: "Compute the greatest common denominator of a set of numbers",
Long: `Compute the greatest common denominator of a set of numbers.`,
Args: cobra.MinimumNArgs(2),
Run: gcd,
Long: `Compute the greatest common denominator of a set of numbers.
Provide the --extended flag to also compute the Bézout coefficients, i.e. coefficients a,b,c,... such that
ax + by + cz + ... = gcd(x,y,z,...)`,
Args: cobra.MinimumNArgs(2),
Run: gcd,
}
func init() {
@@ -87,5 +90,5 @@ func init() {
// is called directly, e.g.:
// gcdCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
gcdCmd.Flags().BoolVarP(&extended, "extended", "e", false, "also compute the Bezout coefficients")
gcdCmd.Flags().BoolVarP(&extended, "extended", "e", false, "also compute the Bézout coefficients")
}