feat(version): adds --short flag to only show release information

This commit is contained in:
Lewis Wynne 2026-02-11 18:16:37 +00:00
parent 9130c09e56
commit 59cb09a8e7
2 changed files with 18 additions and 1 deletions

View file

@ -749,3 +749,18 @@ pda run script
```
<p align="center"></p><!-- spacer -->
### Version
`pda!` uses calendar versioning: `YYYY.WW`. ASCII art can be permanently disabled with `display_ascii_art = false` in config.
```bash
# Display the full version output.
pda version
# Or just the release.
pda version --short
# pda! 2025.47 release
```
<p align="center"></p><!-- spacer -->

View file

@ -36,7 +36,8 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Display pda! version",
Run: func(cmd *cobra.Command, args []string) {
if config.DisplayAsciiArt {
short, _ := cmd.Flags().GetBool("short")
if !short && config.DisplayAsciiArt {
fmt.Print(asciiArt + "\n ")
}
fmt.Printf("%s\n", version)
@ -44,5 +45,6 @@ var versionCmd = &cobra.Command{
}
func init() {
versionCmd.Flags().Bool("short", false, "Print only the version string")
rootCmd.AddCommand(versionCmd)
}